imate
C++/CUDA Reference
py_c_affine_matrix_function.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.36 */
2 
3 /* BEGIN: Cython Metadata
4 {
5  "distutils": {
6  "define_macros": [
7  [
8  "CYTHON_EXTERN_C",
9  "extern \"C\""
10  ],
11  [
12  "CYTHON_EXTERN_C",
13  "extern \"C\""
14  ],
15  [
16  "CYTHON_EXTERN_C",
17  "extern \"C\""
18  ],
19  [
20  "CYTHON_EXTERN_C",
21  "extern \"C\""
22  ],
23  [
24  "CYTHON_EXTERN_C",
25  "extern \"C\""
26  ],
27  [
28  "CYTHON_EXTERN_C",
29  "extern \"C\""
30  ],
31  [
32  "CYTHON_EXTERN_C",
33  "extern \"C\""
34  ],
35  [
36  "CYTHON_EXTERN_C",
37  "extern \"C\""
38  ],
39  [
40  "CYTHON_EXTERN_C",
41  "extern \"C\""
42  ],
43  [
44  "CYTHON_EXTERN_C",
45  "extern \"C\""
46  ],
47  [
48  "CYTHON_EXTERN_C",
49  "extern \"C\""
50  ],
51  [
52  "CYTHON_EXTERN_C",
53  "extern \"C\""
54  ],
55  [
56  "CYTHON_EXTERN_C",
57  "extern \"C\""
58  ],
59  [
60  "CYTHON_EXTERN_C",
61  "extern \"C\""
62  ],
63  [
64  "CYTHON_EXTERN_C",
65  "extern \"C\""
66  ]
67  ],
68  "depends": [
69  "imate/_c_linear_operator/c_affine_matrix_function.h",
70  "imate/_c_linear_operator/c_csc_affine_matrix_function.h",
71  "imate/_c_linear_operator/c_csr_affine_matrix_function.h",
72  "imate/_c_linear_operator/c_dense_affine_matrix_function.h",
73  "imate/_c_linear_operator/c_linear_operator.h",
74  "imate/_definitions/definitions.h"
75  ],
76  "include_dirs": [
77  "./imate/_c_linear_operator",
78  "./imate/_definitions",
79  "i",
80  "m",
81  "a",
82  "t",
83  "e",
84  "/",
85  "_",
86  "c",
87  "b",
88  "s",
89  "l",
90  "g",
91  "r"
92  ],
93  "language": "c++",
94  "name": "imate._c_linear_operator.py_c_affine_matrix_function",
95  "sources": [
96  "./imate/_c_linear_operator/py_c_affine_matrix_function.pyx",
97  "./imate/_c_linear_operator/c_csc_matrix.cpp",
98  "./imate/_c_linear_operator/c_linear_operator.cpp",
99  "./imate/_c_linear_operator/c_matrix.cpp",
100  "./imate/_c_linear_operator/c_affine_matrix_function.cpp",
101  "./imate/_c_linear_operator/c_dense_affine_matrix_function.cpp",
102  "./imate/_c_linear_operator/c_csr_matrix.cpp",
103  "./imate/_c_linear_operator/c_csr_affine_matrix_function.cpp",
104  "./imate/_c_linear_operator/c_csc_affine_matrix_function.cpp",
105  "./imate/_c_linear_operator/c_dense_matrix.cpp",
106  "imate/_c_basic_algebra/c_vector_operations.cpp",
107  "imate/_c_basic_algebra/c_matrix_operations.cpp",
108  "imate/_c_basic_algebra/cblas_interface.cpp"
109  ]
110  },
111  "module_name": "imate._c_linear_operator.py_c_affine_matrix_function"
112 }
113 END: Cython Metadata */
114 
115 #ifndef PY_SSIZE_T_CLEAN
116 #define PY_SSIZE_T_CLEAN
117 #endif /* PY_SSIZE_T_CLEAN */
118 #include "Python.h"
119 #ifndef Py_PYTHON_H
120  #error Python headers needed to compile C extensions, please install development version of Python.
121 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
122  #error Cython requires Python 2.6+ or Python 3.3+.
123 #else
124 #define CYTHON_ABI "0_29_36"
125 #define CYTHON_HEX_VERSION 0x001D24F0
126 #define CYTHON_FUTURE_DIVISION 1
127 #include <stddef.h>
128 #ifndef offsetof
129  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
130 #endif
131 #if !defined(WIN32) && !defined(MS_WINDOWS)
132  #ifndef __stdcall
133  #define __stdcall
134  #endif
135  #ifndef __cdecl
136  #define __cdecl
137  #endif
138  #ifndef __fastcall
139  #define __fastcall
140  #endif
141 #endif
142 #ifndef DL_IMPORT
143  #define DL_IMPORT(t) t
144 #endif
145 #ifndef DL_EXPORT
146  #define DL_EXPORT(t) t
147 #endif
148 #define __PYX_COMMA ,
149 #ifndef HAVE_LONG_LONG
150  #if PY_VERSION_HEX >= 0x02070000
151  #define HAVE_LONG_LONG
152  #endif
153 #endif
154 #ifndef PY_LONG_LONG
155  #define PY_LONG_LONG LONG_LONG
156 #endif
157 #ifndef Py_HUGE_VAL
158  #define Py_HUGE_VAL HUGE_VAL
159 #endif
160 #ifdef PYPY_VERSION
161  #define CYTHON_COMPILING_IN_PYPY 1
162  #define CYTHON_COMPILING_IN_PYSTON 0
163  #define CYTHON_COMPILING_IN_CPYTHON 0
164  #define CYTHON_COMPILING_IN_NOGIL 0
165  #undef CYTHON_USE_TYPE_SLOTS
166  #define CYTHON_USE_TYPE_SLOTS 0
167  #undef CYTHON_USE_PYTYPE_LOOKUP
168  #define CYTHON_USE_PYTYPE_LOOKUP 0
169  #if PY_VERSION_HEX < 0x03050000
170  #undef CYTHON_USE_ASYNC_SLOTS
171  #define CYTHON_USE_ASYNC_SLOTS 0
172  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
173  #define CYTHON_USE_ASYNC_SLOTS 1
174  #endif
175  #undef CYTHON_USE_PYLIST_INTERNALS
176  #define CYTHON_USE_PYLIST_INTERNALS 0
177  #undef CYTHON_USE_UNICODE_INTERNALS
178  #define CYTHON_USE_UNICODE_INTERNALS 0
179  #undef CYTHON_USE_UNICODE_WRITER
180  #define CYTHON_USE_UNICODE_WRITER 0
181  #undef CYTHON_USE_PYLONG_INTERNALS
182  #define CYTHON_USE_PYLONG_INTERNALS 0
183  #undef CYTHON_AVOID_BORROWED_REFS
184  #define CYTHON_AVOID_BORROWED_REFS 1
185  #undef CYTHON_ASSUME_SAFE_MACROS
186  #define CYTHON_ASSUME_SAFE_MACROS 0
187  #undef CYTHON_UNPACK_METHODS
188  #define CYTHON_UNPACK_METHODS 0
189  #undef CYTHON_FAST_THREAD_STATE
190  #define CYTHON_FAST_THREAD_STATE 0
191  #undef CYTHON_FAST_PYCALL
192  #define CYTHON_FAST_PYCALL 0
193  #if PY_VERSION_HEX < 0x03090000
194  #undef CYTHON_PEP489_MULTI_PHASE_INIT
195  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
196  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
197  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
198  #endif
199  #undef CYTHON_USE_TP_FINALIZE
200  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
201  #undef CYTHON_USE_DICT_VERSIONS
202  #define CYTHON_USE_DICT_VERSIONS 0
203  #undef CYTHON_USE_EXC_INFO_STACK
204  #define CYTHON_USE_EXC_INFO_STACK 0
205  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
207  #endif
208 #elif defined(PYSTON_VERSION)
209  #define CYTHON_COMPILING_IN_PYPY 0
210  #define CYTHON_COMPILING_IN_PYSTON 1
211  #define CYTHON_COMPILING_IN_CPYTHON 0
212  #define CYTHON_COMPILING_IN_NOGIL 0
213  #ifndef CYTHON_USE_TYPE_SLOTS
214  #define CYTHON_USE_TYPE_SLOTS 1
215  #endif
216  #undef CYTHON_USE_PYTYPE_LOOKUP
217  #define CYTHON_USE_PYTYPE_LOOKUP 0
218  #undef CYTHON_USE_ASYNC_SLOTS
219  #define CYTHON_USE_ASYNC_SLOTS 0
220  #undef CYTHON_USE_PYLIST_INTERNALS
221  #define CYTHON_USE_PYLIST_INTERNALS 0
222  #ifndef CYTHON_USE_UNICODE_INTERNALS
223  #define CYTHON_USE_UNICODE_INTERNALS 1
224  #endif
225  #undef CYTHON_USE_UNICODE_WRITER
226  #define CYTHON_USE_UNICODE_WRITER 0
227  #undef CYTHON_USE_PYLONG_INTERNALS
228  #define CYTHON_USE_PYLONG_INTERNALS 0
229  #ifndef CYTHON_AVOID_BORROWED_REFS
230  #define CYTHON_AVOID_BORROWED_REFS 0
231  #endif
232  #ifndef CYTHON_ASSUME_SAFE_MACROS
233  #define CYTHON_ASSUME_SAFE_MACROS 1
234  #endif
235  #ifndef CYTHON_UNPACK_METHODS
236  #define CYTHON_UNPACK_METHODS 1
237  #endif
238  #undef CYTHON_FAST_THREAD_STATE
239  #define CYTHON_FAST_THREAD_STATE 0
240  #undef CYTHON_FAST_PYCALL
241  #define CYTHON_FAST_PYCALL 0
242  #undef CYTHON_PEP489_MULTI_PHASE_INIT
243  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
244  #undef CYTHON_USE_TP_FINALIZE
245  #define CYTHON_USE_TP_FINALIZE 0
246  #undef CYTHON_USE_DICT_VERSIONS
247  #define CYTHON_USE_DICT_VERSIONS 0
248  #undef CYTHON_USE_EXC_INFO_STACK
249  #define CYTHON_USE_EXC_INFO_STACK 0
250  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
251  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
252  #endif
253 #elif defined(PY_NOGIL)
254  #define CYTHON_COMPILING_IN_PYPY 0
255  #define CYTHON_COMPILING_IN_PYSTON 0
256  #define CYTHON_COMPILING_IN_CPYTHON 0
257  #define CYTHON_COMPILING_IN_NOGIL 1
258  #ifndef CYTHON_USE_TYPE_SLOTS
259  #define CYTHON_USE_TYPE_SLOTS 1
260  #endif
261  #undef CYTHON_USE_PYTYPE_LOOKUP
262  #define CYTHON_USE_PYTYPE_LOOKUP 0
263  #ifndef CYTHON_USE_ASYNC_SLOTS
264  #define CYTHON_USE_ASYNC_SLOTS 1
265  #endif
266  #undef CYTHON_USE_PYLIST_INTERNALS
267  #define CYTHON_USE_PYLIST_INTERNALS 0
268  #ifndef CYTHON_USE_UNICODE_INTERNALS
269  #define CYTHON_USE_UNICODE_INTERNALS 1
270  #endif
271  #undef CYTHON_USE_UNICODE_WRITER
272  #define CYTHON_USE_UNICODE_WRITER 0
273  #undef CYTHON_USE_PYLONG_INTERNALS
274  #define CYTHON_USE_PYLONG_INTERNALS 0
275  #ifndef CYTHON_AVOID_BORROWED_REFS
276  #define CYTHON_AVOID_BORROWED_REFS 0
277  #endif
278  #ifndef CYTHON_ASSUME_SAFE_MACROS
279  #define CYTHON_ASSUME_SAFE_MACROS 1
280  #endif
281  #ifndef CYTHON_UNPACK_METHODS
282  #define CYTHON_UNPACK_METHODS 1
283  #endif
284  #undef CYTHON_FAST_THREAD_STATE
285  #define CYTHON_FAST_THREAD_STATE 0
286  #undef CYTHON_FAST_PYCALL
287  #define CYTHON_FAST_PYCALL 0
288  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
289  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
290  #endif
291  #ifndef CYTHON_USE_TP_FINALIZE
292  #define CYTHON_USE_TP_FINALIZE 1
293  #endif
294  #undef CYTHON_USE_DICT_VERSIONS
295  #define CYTHON_USE_DICT_VERSIONS 0
296  #undef CYTHON_USE_EXC_INFO_STACK
297  #define CYTHON_USE_EXC_INFO_STACK 0
298 #else
299  #define CYTHON_COMPILING_IN_PYPY 0
300  #define CYTHON_COMPILING_IN_PYSTON 0
301  #define CYTHON_COMPILING_IN_CPYTHON 1
302  #define CYTHON_COMPILING_IN_NOGIL 0
303  #ifndef CYTHON_USE_TYPE_SLOTS
304  #define CYTHON_USE_TYPE_SLOTS 1
305  #endif
306  #if PY_VERSION_HEX < 0x02070000
307  #undef CYTHON_USE_PYTYPE_LOOKUP
308  #define CYTHON_USE_PYTYPE_LOOKUP 0
309  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
310  #define CYTHON_USE_PYTYPE_LOOKUP 1
311  #endif
312  #if PY_MAJOR_VERSION < 3
313  #undef CYTHON_USE_ASYNC_SLOTS
314  #define CYTHON_USE_ASYNC_SLOTS 0
315  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
316  #define CYTHON_USE_ASYNC_SLOTS 1
317  #endif
318  #if PY_VERSION_HEX < 0x02070000
319  #undef CYTHON_USE_PYLONG_INTERNALS
320  #define CYTHON_USE_PYLONG_INTERNALS 0
321  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
322  #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
323  #endif
324  #ifndef CYTHON_USE_PYLIST_INTERNALS
325  #define CYTHON_USE_PYLIST_INTERNALS 1
326  #endif
327  #ifndef CYTHON_USE_UNICODE_INTERNALS
328  #define CYTHON_USE_UNICODE_INTERNALS 1
329  #endif
330  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
331  #undef CYTHON_USE_UNICODE_WRITER
332  #define CYTHON_USE_UNICODE_WRITER 0
333  #elif !defined(CYTHON_USE_UNICODE_WRITER)
334  #define CYTHON_USE_UNICODE_WRITER 1
335  #endif
336  #ifndef CYTHON_AVOID_BORROWED_REFS
337  #define CYTHON_AVOID_BORROWED_REFS 0
338  #endif
339  #ifndef CYTHON_ASSUME_SAFE_MACROS
340  #define CYTHON_ASSUME_SAFE_MACROS 1
341  #endif
342  #ifndef CYTHON_UNPACK_METHODS
343  #define CYTHON_UNPACK_METHODS 1
344  #endif
345  #if PY_VERSION_HEX >= 0x030B00A4
346  #undef CYTHON_FAST_THREAD_STATE
347  #define CYTHON_FAST_THREAD_STATE 0
348  #elif !defined(CYTHON_FAST_THREAD_STATE)
349  #define CYTHON_FAST_THREAD_STATE 1
350  #endif
351  #ifndef CYTHON_FAST_PYCALL
352  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
353  #endif
354  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
355  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
356  #endif
357  #ifndef CYTHON_USE_TP_FINALIZE
358  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
359  #endif
360  #ifndef CYTHON_USE_DICT_VERSIONS
361  #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
362  #endif
363  #if PY_VERSION_HEX >= 0x030B00A4
364  #undef CYTHON_USE_EXC_INFO_STACK
365  #define CYTHON_USE_EXC_INFO_STACK 0
366  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
367  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
368  #endif
369  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
370  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
371  #endif
372 #endif
373 #if !defined(CYTHON_FAST_PYCCALL)
374 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
375 #endif
376 #if CYTHON_USE_PYLONG_INTERNALS
377  #if PY_MAJOR_VERSION < 3
378  #include "longintrepr.h"
379  #endif
380  #undef SHIFT
381  #undef BASE
382  #undef MASK
383  #ifdef SIZEOF_VOID_P
384  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
385  #endif
386 #endif
387 #ifndef __has_attribute
388  #define __has_attribute(x) 0
389 #endif
390 #ifndef __has_cpp_attribute
391  #define __has_cpp_attribute(x) 0
392 #endif
393 #ifndef CYTHON_RESTRICT
394  #if defined(__GNUC__)
395  #define CYTHON_RESTRICT __restrict__
396  #elif defined(_MSC_VER) && _MSC_VER >= 1400
397  #define CYTHON_RESTRICT __restrict
398  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
399  #define CYTHON_RESTRICT restrict
400  #else
401  #define CYTHON_RESTRICT
402  #endif
403 #endif
404 #ifndef CYTHON_UNUSED
405 # if defined(__GNUC__)
406 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
407 # define CYTHON_UNUSED __attribute__ ((__unused__))
408 # else
409 # define CYTHON_UNUSED
410 # endif
411 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
412 # define CYTHON_UNUSED __attribute__ ((__unused__))
413 # else
414 # define CYTHON_UNUSED
415 # endif
416 #endif
417 #ifndef CYTHON_MAYBE_UNUSED_VAR
418 # if defined(__cplusplus)
419  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
420 # else
421 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
422 # endif
423 #endif
424 #ifndef CYTHON_NCP_UNUSED
425 # if CYTHON_COMPILING_IN_CPYTHON
426 # define CYTHON_NCP_UNUSED
427 # else
428 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
429 # endif
430 #endif
431 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
432 #ifdef _MSC_VER
433  #ifndef _MSC_STDINT_H_
434  #if _MSC_VER < 1300
435  typedef unsigned char uint8_t;
436  typedef unsigned int uint32_t;
437  #else
438  typedef unsigned __int8 uint8_t;
439  typedef unsigned __int32 uint32_t;
440  #endif
441  #endif
442 #else
443  #include <stdint.h>
444 #endif
445 #ifndef CYTHON_FALLTHROUGH
446  #if defined(__cplusplus) && __cplusplus >= 201103L
447  #if __has_cpp_attribute(fallthrough)
448  #define CYTHON_FALLTHROUGH [[fallthrough]]
449  #elif __has_cpp_attribute(clang::fallthrough)
450  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
451  #elif __has_cpp_attribute(gnu::fallthrough)
452  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
453  #endif
454  #endif
455  #ifndef CYTHON_FALLTHROUGH
456  #if __has_attribute(fallthrough)
457  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
458  #else
459  #define CYTHON_FALLTHROUGH
460  #endif
461  #endif
462  #if defined(__clang__ ) && defined(__apple_build_version__)
463  #if __apple_build_version__ < 7000000
464  #undef CYTHON_FALLTHROUGH
465  #define CYTHON_FALLTHROUGH
466  #endif
467  #endif
468 #endif
469 
470 #ifndef __cplusplus
471  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
472 #endif
473 #ifndef CYTHON_INLINE
474  #if defined(__clang__)
475  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
476  #else
477  #define CYTHON_INLINE inline
478  #endif
479 #endif
480 template<typename T>
481 void __Pyx_call_destructor(T& x) {
482  x.~T();
483 }
484 template<typename T>
485 class __Pyx_FakeReference {
486  public:
487  __Pyx_FakeReference() : ptr(NULL) { }
488  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
489  T *operator->() { return ptr; }
490  T *operator&() { return ptr; }
491  operator T&() { return *ptr; }
492  template<typename U> bool operator ==(U other) { return *ptr == other; }
493  template<typename U> bool operator !=(U other) { return *ptr != other; }
494  private:
495  T *ptr;
496 };
497 
498 #define __PYX_BUILD_PY_SSIZE_T "n"
499 #define CYTHON_FORMAT_SSIZE_T "z"
500 #if PY_MAJOR_VERSION < 3
501  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
502  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
503  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
504  #define __Pyx_DefaultClassType PyClass_Type
505 #else
506  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
507  #define __Pyx_DefaultClassType PyType_Type
508 #if PY_VERSION_HEX >= 0x030B00A1
509  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
510  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
511  PyObject *fv, PyObject *cell, PyObject* fn,
512  PyObject *name, int fline, PyObject *lnos) {
513  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
514  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
515  const char *fn_cstr=NULL;
516  const char *name_cstr=NULL;
517  PyCodeObject* co=NULL;
518  PyObject *type, *value, *traceback;
519  PyErr_Fetch(&type, &value, &traceback);
520  if (!(kwds=PyDict_New())) goto end;
521  if (!(argcount=PyLong_FromLong(a))) goto end;
522  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
523  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
524  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
525  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
526  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
527  if (!(nlocals=PyLong_FromLong(l))) goto end;
528  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
529  if (!(stacksize=PyLong_FromLong(s))) goto end;
530  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
531  if (!(flags=PyLong_FromLong(f))) goto end;
532  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
533  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
534  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
535  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
536  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
537  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
538  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
539  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
540  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
541  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
542  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
543  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
544  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
545  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
546  Py_XDECREF((PyObject*)co);
547  co = (PyCodeObject*)call_result;
548  call_result = NULL;
549  if (0) {
550  cleanup_code_too:
551  Py_XDECREF((PyObject*)co);
552  co = NULL;
553  }
554  end:
555  Py_XDECREF(kwds);
556  Py_XDECREF(argcount);
557  Py_XDECREF(posonlyargcount);
558  Py_XDECREF(kwonlyargcount);
559  Py_XDECREF(nlocals);
560  Py_XDECREF(stacksize);
561  Py_XDECREF(replace);
562  Py_XDECREF(call_result);
563  Py_XDECREF(empty);
564  if (type) {
565  PyErr_Restore(type, value, traceback);
566  }
567  return co;
568  }
569 #else
570  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
571  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
572 #endif
573  #define __Pyx_DefaultClassType PyType_Type
574 #endif
575 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
576  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
577 #else
578  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
579 #endif
580 #ifndef Py_TPFLAGS_CHECKTYPES
581  #define Py_TPFLAGS_CHECKTYPES 0
582 #endif
583 #ifndef Py_TPFLAGS_HAVE_INDEX
584  #define Py_TPFLAGS_HAVE_INDEX 0
585 #endif
586 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
587  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
588 #endif
589 #ifndef Py_TPFLAGS_HAVE_FINALIZE
590  #define Py_TPFLAGS_HAVE_FINALIZE 0
591 #endif
592 #ifndef METH_STACKLESS
593  #define METH_STACKLESS 0
594 #endif
595 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
596  #ifndef METH_FASTCALL
597  #define METH_FASTCALL 0x80
598  #endif
599  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
600  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
601  Py_ssize_t nargs, PyObject *kwnames);
602 #else
603  #define __Pyx_PyCFunctionFast _PyCFunctionFast
604  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
605 #endif
606 #if CYTHON_FAST_PYCCALL
607 #define __Pyx_PyFastCFunction_Check(func)\
608  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
609 #else
610 #define __Pyx_PyFastCFunction_Check(func) 0
611 #endif
612 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
613  #define PyObject_Malloc(s) PyMem_Malloc(s)
614  #define PyObject_Free(p) PyMem_Free(p)
615  #define PyObject_Realloc(p) PyMem_Realloc(p)
616 #endif
617 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
618  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
619  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
620  #define PyMem_RawFree(p) PyMem_Free(p)
621 #endif
622 #if CYTHON_COMPILING_IN_PYSTON
623  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
624  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
625 #else
626  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
627  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
628 #endif
629 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
630  #define __Pyx_PyThreadState_Current PyThreadState_GET()
631 #elif PY_VERSION_HEX >= 0x03060000
632  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
633 #elif PY_VERSION_HEX >= 0x03000000
634  #define __Pyx_PyThreadState_Current PyThreadState_GET()
635 #else
636  #define __Pyx_PyThreadState_Current _PyThreadState_Current
637 #endif
638 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
639 #include "pythread.h"
640 #define Py_tss_NEEDS_INIT 0
641 typedef int Py_tss_t;
642 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
643  *key = PyThread_create_key();
644  return 0;
645 }
646 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
647  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
648  *key = Py_tss_NEEDS_INIT;
649  return key;
650 }
651 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
652  PyObject_Free(key);
653 }
654 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
655  return *key != Py_tss_NEEDS_INIT;
656 }
657 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
658  PyThread_delete_key(*key);
659  *key = Py_tss_NEEDS_INIT;
660 }
661 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
662  return PyThread_set_key_value(*key, value);
663 }
664 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
665  return PyThread_get_key_value(*key);
666 }
667 #endif
668 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
669 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
670 #else
671 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
672 #endif
673 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
674  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
675  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
676 #else
677  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
678  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
679 #endif
680 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
681 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
682 #else
683 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
684 #endif
685 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
686  #define CYTHON_PEP393_ENABLED 1
687  #if PY_VERSION_HEX >= 0x030C0000
688  #define __Pyx_PyUnicode_READY(op) (0)
689  #else
690  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
691  0 : _PyUnicode_Ready((PyObject *)(op)))
692  #endif
693  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
694  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
695  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
696  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
697  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
698  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
699  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
700  #if PY_VERSION_HEX >= 0x030C0000
701  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
702  #else
703  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
704  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
705  #else
706  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
707  #endif
708  #endif
709 #else
710  #define CYTHON_PEP393_ENABLED 0
711  #define PyUnicode_1BYTE_KIND 1
712  #define PyUnicode_2BYTE_KIND 2
713  #define PyUnicode_4BYTE_KIND 4
714  #define __Pyx_PyUnicode_READY(op) (0)
715  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
716  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
717  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
718  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
719  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
720  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
721  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
722  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
723 #endif
724 #if CYTHON_COMPILING_IN_PYPY
725  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
726  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
727 #else
728  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
729  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
730  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
731 #endif
732 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
733  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
734 #endif
735 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
736  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
737 #endif
738 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
739  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
740 #endif
741 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
742 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
743 #if PY_MAJOR_VERSION >= 3
744  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
745 #else
746  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
747 #endif
748 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
749  #define PyObject_ASCII(o) PyObject_Repr(o)
750 #endif
751 #if PY_MAJOR_VERSION >= 3
752  #define PyBaseString_Type PyUnicode_Type
753  #define PyStringObject PyUnicodeObject
754  #define PyString_Type PyUnicode_Type
755  #define PyString_Check PyUnicode_Check
756  #define PyString_CheckExact PyUnicode_CheckExact
757 #ifndef PyObject_Unicode
758  #define PyObject_Unicode PyObject_Str
759 #endif
760 #endif
761 #if PY_MAJOR_VERSION >= 3
762  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
763  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
764 #else
765  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
766  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
767 #endif
768 #ifndef PySet_CheckExact
769  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
770 #endif
771 #if PY_VERSION_HEX >= 0x030900A4
772  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
773  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
774 #else
775  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
776  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
777 #endif
778 #if CYTHON_ASSUME_SAFE_MACROS
779  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
780 #else
781  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
782 #endif
783 #if PY_MAJOR_VERSION >= 3
784  #define PyIntObject PyLongObject
785  #define PyInt_Type PyLong_Type
786  #define PyInt_Check(op) PyLong_Check(op)
787  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
788  #define PyInt_FromString PyLong_FromString
789  #define PyInt_FromUnicode PyLong_FromUnicode
790  #define PyInt_FromLong PyLong_FromLong
791  #define PyInt_FromSize_t PyLong_FromSize_t
792  #define PyInt_FromSsize_t PyLong_FromSsize_t
793  #define PyInt_AsLong PyLong_AsLong
794  #define PyInt_AS_LONG PyLong_AS_LONG
795  #define PyInt_AsSsize_t PyLong_AsSsize_t
796  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
797  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
798  #define PyNumber_Int PyNumber_Long
799 #endif
800 #if PY_MAJOR_VERSION >= 3
801  #define PyBoolObject PyLongObject
802 #endif
803 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
804  #ifndef PyUnicode_InternFromString
805  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
806  #endif
807 #endif
808 #if PY_VERSION_HEX < 0x030200A4
809  typedef long Py_hash_t;
810  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
811  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
812 #else
813  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
814  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
815 #endif
816 #if PY_MAJOR_VERSION >= 3
817  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
818 #else
819  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
820 #endif
821 #if CYTHON_USE_ASYNC_SLOTS
822  #if PY_VERSION_HEX >= 0x030500B1
823  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
824  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
825  #else
826  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
827  #endif
828 #else
829  #define __Pyx_PyType_AsAsync(obj) NULL
830 #endif
831 #ifndef __Pyx_PyAsyncMethodsStruct
832  typedef struct {
833  unaryfunc am_await;
834  unaryfunc am_aiter;
835  unaryfunc am_anext;
836  } __Pyx_PyAsyncMethodsStruct;
837 #endif
838 
839 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
840  #if !defined(_USE_MATH_DEFINES)
841  #define _USE_MATH_DEFINES
842  #endif
843 #endif
844 #include <math.h>
845 #ifdef NAN
846 #define __PYX_NAN() ((float) NAN)
847 #else
848 static CYTHON_INLINE float __PYX_NAN() {
849  float value;
850  memset(&value, 0xFF, sizeof(value));
851  return value;
852 }
853 #endif
854 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
855 #define __Pyx_truncl trunc
856 #else
857 #define __Pyx_truncl truncl
858 #endif
859 
860 #define __PYX_MARK_ERR_POS(f_index, lineno) \
861  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
862 #define __PYX_ERR(f_index, lineno, Ln_error) \
863  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
864 
865 #ifndef __PYX_EXTERN_C
866  #ifdef __cplusplus
867  #define __PYX_EXTERN_C extern "C"
868  #else
869  #define __PYX_EXTERN_C extern
870  #endif
871 #endif
872 
873 #define __PYX_HAVE__imate___c_linear_operator__py_c_affine_matrix_function
874 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_affine_matrix_function
875 /* Early includes */
876 #include "./definitions.h"
877 #include "ios"
878 #include "new"
879 #include "stdexcept"
880 #include "typeinfo"
881 #include "c_linear_operator.h"
886 #include "pythread.h"
887 #include <string.h>
888 #include <stdlib.h>
889 #include <stdio.h>
890 #include "pystate.h"
891 #ifdef _OPENMP
892 #include <omp.h>
893 #endif /* _OPENMP */
894 
895 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
896 #define CYTHON_WITHOUT_ASSERTIONS
897 #endif
898 
899 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
900  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
901 
902 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
903 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
904 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
905 #define __PYX_DEFAULT_STRING_ENCODING ""
906 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
907 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
908 #define __Pyx_uchar_cast(c) ((unsigned char)c)
909 #define __Pyx_long_cast(x) ((long)x)
910 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
911  (sizeof(type) < sizeof(Py_ssize_t)) ||\
912  (sizeof(type) > sizeof(Py_ssize_t) &&\
913  likely(v < (type)PY_SSIZE_T_MAX ||\
914  v == (type)PY_SSIZE_T_MAX) &&\
915  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
916  v == (type)PY_SSIZE_T_MIN))) ||\
917  (sizeof(type) == sizeof(Py_ssize_t) &&\
918  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
919  v == (type)PY_SSIZE_T_MAX))) )
920 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
921  return (size_t) i < (size_t) limit;
922 }
923 #if defined (__cplusplus) && __cplusplus >= 201103L
924  #include <cstdlib>
925  #define __Pyx_sst_abs(value) std::abs(value)
926 #elif SIZEOF_INT >= SIZEOF_SIZE_T
927  #define __Pyx_sst_abs(value) abs(value)
928 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
929  #define __Pyx_sst_abs(value) labs(value)
930 #elif defined (_MSC_VER)
931  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
932 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
933  #define __Pyx_sst_abs(value) llabs(value)
934 #elif defined (__GNUC__)
935  #define __Pyx_sst_abs(value) __builtin_llabs(value)
936 #else
937  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
938 #endif
939 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
940 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
941 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
942 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
943 #define __Pyx_PyBytes_FromString PyBytes_FromString
944 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
945 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
946 #if PY_MAJOR_VERSION < 3
947  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
948  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
949 #else
950  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
951  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
952 #endif
953 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
954 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
955 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
956 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
957 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
958 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
959 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
960 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
961 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
962 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
963 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
964 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
965 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
966 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
967 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
968 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
969 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
970  const Py_UNICODE *u_end = u;
971  while (*u_end++) ;
972  return (size_t)(u_end - u - 1);
973 }
974 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
975 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
976 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
977 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
978 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
979 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
980 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
981 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
982 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
983 #define __Pyx_PySequence_Tuple(obj)\
984  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
985 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
986 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
987 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
988 #if CYTHON_ASSUME_SAFE_MACROS
989 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
990 #else
991 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
992 #endif
993 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
994 #if PY_MAJOR_VERSION >= 3
995 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
996 #else
997 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
998 #endif
999 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1000 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1001 static int __Pyx_sys_getdefaultencoding_not_ascii;
1002 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1003  PyObject* sys;
1004  PyObject* default_encoding = NULL;
1005  PyObject* ascii_chars_u = NULL;
1006  PyObject* ascii_chars_b = NULL;
1007  const char* default_encoding_c;
1008  sys = PyImport_ImportModule("sys");
1009  if (!sys) goto bad;
1010  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1011  Py_DECREF(sys);
1012  if (!default_encoding) goto bad;
1013  default_encoding_c = PyBytes_AsString(default_encoding);
1014  if (!default_encoding_c) goto bad;
1015  if (strcmp(default_encoding_c, "ascii") == 0) {
1016  __Pyx_sys_getdefaultencoding_not_ascii = 0;
1017  } else {
1018  char ascii_chars[128];
1019  int c;
1020  for (c = 0; c < 128; c++) {
1021  ascii_chars[c] = c;
1022  }
1023  __Pyx_sys_getdefaultencoding_not_ascii = 1;
1024  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1025  if (!ascii_chars_u) goto bad;
1026  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1027  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1028  PyErr_Format(
1029  PyExc_ValueError,
1030  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1031  default_encoding_c);
1032  goto bad;
1033  }
1034  Py_DECREF(ascii_chars_u);
1035  Py_DECREF(ascii_chars_b);
1036  }
1037  Py_DECREF(default_encoding);
1038  return 0;
1039 bad:
1040  Py_XDECREF(default_encoding);
1041  Py_XDECREF(ascii_chars_u);
1042  Py_XDECREF(ascii_chars_b);
1043  return -1;
1044 }
1045 #endif
1046 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1047 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1048 #else
1049 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1050 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1051 static char* __PYX_DEFAULT_STRING_ENCODING;
1052 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1053  PyObject* sys;
1054  PyObject* default_encoding = NULL;
1055  char* default_encoding_c;
1056  sys = PyImport_ImportModule("sys");
1057  if (!sys) goto bad;
1058  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1059  Py_DECREF(sys);
1060  if (!default_encoding) goto bad;
1061  default_encoding_c = PyBytes_AsString(default_encoding);
1062  if (!default_encoding_c) goto bad;
1063  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1064  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1065  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1066  Py_DECREF(default_encoding);
1067  return 0;
1068 bad:
1069  Py_XDECREF(default_encoding);
1070  return -1;
1071 }
1072 #endif
1073 #endif
1074 
1075 
1076 /* Test for GCC > 2.95 */
1077 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1078  #define likely(x) __builtin_expect(!!(x), 1)
1079  #define unlikely(x) __builtin_expect(!!(x), 0)
1080 #else /* !__GNUC__ or GCC < 2.95 */
1081  #define likely(x) (x)
1082  #define unlikely(x) (x)
1083 #endif /* __GNUC__ */
1084 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1085 
1086 static PyObject *__pyx_m = NULL;
1087 static PyObject *__pyx_d;
1088 static PyObject *__pyx_b;
1089 static PyObject *__pyx_cython_runtime = NULL;
1090 static PyObject *__pyx_empty_tuple;
1091 static PyObject *__pyx_empty_bytes;
1092 static PyObject *__pyx_empty_unicode;
1093 static int __pyx_lineno;
1094 static int __pyx_clineno = 0;
1095 static const char * __pyx_cfilenm= __FILE__;
1096 static const char *__pyx_filename;
1097 
1098 
1099 static const char *__pyx_f[] = {
1100  "imate/_c_linear_operator/py_c_affine_matrix_function.pyx",
1101  "stringsource",
1102 };
1103 /* MemviewSliceStruct.proto */
1104 struct __pyx_memoryview_obj;
1105 typedef struct {
1106  struct __pyx_memoryview_obj *memview;
1107  char *data;
1108  Py_ssize_t shape[8];
1109  Py_ssize_t strides[8];
1110  Py_ssize_t suboffsets[8];
1111 } __Pyx_memviewslice;
1112 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1113 
1114 /* Atomics.proto */
1115 #include <pythread.h>
1116 #ifndef CYTHON_ATOMICS
1117  #define CYTHON_ATOMICS 1
1118 #endif
1119 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1120 #define __pyx_atomic_int_type int
1121 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1122  (__GNUC_MINOR__ > 1 ||\
1123  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1124  #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1125  #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1126  #ifdef __PYX_DEBUG_ATOMICS
1127  #warning "Using GNU atomics"
1128  #endif
1129 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1130  #include <intrin.h>
1131  #undef __pyx_atomic_int_type
1132  #define __pyx_atomic_int_type long
1133  #pragma intrinsic (_InterlockedExchangeAdd)
1134  #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1135  #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1136  #ifdef __PYX_DEBUG_ATOMICS
1137  #pragma message ("Using MSVC atomics")
1138  #endif
1139 #else
1140  #undef CYTHON_ATOMICS
1141  #define CYTHON_ATOMICS 0
1142  #ifdef __PYX_DEBUG_ATOMICS
1143  #warning "Not using atomics"
1144  #endif
1145 #endif
1146 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1147 #if CYTHON_ATOMICS
1148  #define __pyx_add_acquisition_count(memview)\
1149  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1150  #define __pyx_sub_acquisition_count(memview)\
1151  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1152 #else
1153  #define __pyx_add_acquisition_count(memview)\
1154  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1155  #define __pyx_sub_acquisition_count(memview)\
1156  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1157 #endif
1158 
1159 /* ForceInitThreads.proto */
1160 #ifndef __PYX_FORCE_INIT_THREADS
1161  #define __PYX_FORCE_INIT_THREADS 0
1162 #endif
1163 
1164 /* NoFastGil.proto */
1165 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1166 #define __Pyx_PyGILState_Release PyGILState_Release
1167 #define __Pyx_FastGIL_Remember()
1168 #define __Pyx_FastGIL_Forget()
1169 #define __Pyx_FastGilFuncInit()
1170 
1171 /* BufferFormatStructs.proto */
1172 #define IS_UNSIGNED(type) (((type) -1) > 0)
1173 struct __Pyx_StructField_;
1174 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1175 typedef struct {
1176  const char* name;
1177  struct __Pyx_StructField_* fields;
1178  size_t size;
1179  size_t arraysize[8];
1180  int ndim;
1181  char typegroup;
1182  char is_unsigned;
1183  int flags;
1184 } __Pyx_TypeInfo;
1185 typedef struct __Pyx_StructField_ {
1186  __Pyx_TypeInfo* type;
1187  const char* name;
1188  size_t offset;
1189 } __Pyx_StructField;
1190 typedef struct {
1191  __Pyx_StructField* field;
1192  size_t parent_offset;
1193 } __Pyx_BufFmt_StackElem;
1194 typedef struct {
1195  __Pyx_StructField root;
1196  __Pyx_BufFmt_StackElem* head;
1197  size_t fmt_offset;
1198  size_t new_count, enc_count;
1199  size_t struct_alignment;
1200  int is_complex;
1201  char enc_type;
1202  char new_packmode;
1203  char enc_packmode;
1204  char is_valid_array;
1205 } __Pyx_BufFmt_Context;
1206 
1207 
1208 /* "_definitions/types.pxd":110
1209  *
1210  * # Used for indices of small matrices, or small size iterators
1211  * ctypedef int IndexType # <<<<<<<<<<<<<<
1212  * ctypedef int[:] MemoryViewIndexType
1213  *
1214  */
1215 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1216 
1217 /* "_definitions/types.pxd":114
1218  *
1219  * # Used for both flags and integers used as signals, including negative integers
1220  * ctypedef int FlagType # <<<<<<<<<<<<<<
1221  * ctypedef int[:] MemoryViewFlagType
1222  *
1223  */
1224 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1225 
1226 /*--- Type declarations ---*/
1227 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1228 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1229 struct __pyx_array_obj;
1230 struct __pyx_MemviewEnum_obj;
1231 struct __pyx_memoryview_obj;
1232 struct __pyx_memoryviewslice_obj;
1233 
1234 /* "_definitions/types.pxd":107
1235  * ctypedef unsigned int[:] MemoryViewLongIndexType
1236  * ELSE:
1237  * ctypedef int[:] MemoryViewLongIndexType # <<<<<<<<<<<<<<
1238  *
1239  * # Used for indices of small matrices, or small size iterators
1240  */
1241 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1242 
1243 /* "_definitions/types.pxd":111
1244  * # Used for indices of small matrices, or small size iterators
1245  * ctypedef int IndexType
1246  * ctypedef int[:] MemoryViewIndexType # <<<<<<<<<<<<<<
1247  *
1248  * # Used for both flags and integers used as signals, including negative integers
1249  */
1250 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1251 
1252 /* "_definitions/types.pxd":115
1253  * # Used for both flags and integers used as signals, including negative integers
1254  * ctypedef int FlagType
1255  * ctypedef int[:] MemoryViewFlagType # <<<<<<<<<<<<<<
1256  *
1257  *
1258  */
1259 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1260 
1261 /* "_definitions/types.pxd":122
1262  * # ==============
1263  *
1264  * ctypedef double (*kernel_type)( # noqa: E211 # <<<<<<<<<<<<<<
1265  * const double x,
1266  * const double kernel_param) nogil
1267  */
1268 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(double const , double const );
1269 
1270 /* "py_c_linear_operator.pxd":23
1271  * # ===================
1272  *
1273  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1274  *
1275  * # Attributes
1276  */
1277 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1278  PyObject_HEAD
1279  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1280  cLinearOperator<float> *Aop_float;
1281  cLinearOperator<double> *Aop_double;
1282  cLinearOperator<long double> *Aop_long_double;
1283  char *data_type_name;
1284  char *long_index_type_name;
1285  __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1286  PyObject *parameters;
1287 };
1288 
1289 
1290 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pxd":21
1291  * # ==========================
1292  *
1293  * cdef class pycAffineMatrixFunction(pycLinearOperator): # <<<<<<<<<<<<<<
1294  * cdef A_csr
1295  * cdef B_csr
1296  */
1297 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1298  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1299  PyObject *A_csr;
1300  PyObject *B_csr;
1301  PyObject *A_indices_copy;
1302  PyObject *A_index_pointer_copy;
1303  PyObject *B_indices_copy;
1304  PyObject *B_index_pointer_copy;
1305 };
1306 
1307 
1308 /* "View.MemoryView":106
1309  *
1310  * @cname("__pyx_array")
1311  * cdef class array: # <<<<<<<<<<<<<<
1312  *
1313  * cdef:
1314  */
1315 struct __pyx_array_obj {
1316  PyObject_HEAD
1317  struct __pyx_vtabstruct_array *__pyx_vtab;
1318  char *data;
1319  Py_ssize_t len;
1320  char *format;
1321  int ndim;
1322  Py_ssize_t *_shape;
1323  Py_ssize_t *_strides;
1324  Py_ssize_t itemsize;
1325  PyObject *mode;
1326  PyObject *_format;
1327  void (*callback_free_data)(void *);
1328  int free_data;
1329  int dtype_is_object;
1330 };
1331 
1332 
1333 /* "View.MemoryView":280
1334  *
1335  * @cname('__pyx_MemviewEnum')
1336  * cdef class Enum(object): # <<<<<<<<<<<<<<
1337  * cdef object name
1338  * def __init__(self, name):
1339  */
1340 struct __pyx_MemviewEnum_obj {
1341  PyObject_HEAD
1342  PyObject *name;
1343 };
1344 
1345 
1346 /* "View.MemoryView":331
1347  *
1348  * @cname('__pyx_memoryview')
1349  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1350  *
1351  * cdef object obj
1352  */
1353 struct __pyx_memoryview_obj {
1354  PyObject_HEAD
1355  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1356  PyObject *obj;
1357  PyObject *_size;
1358  PyObject *_array_interface;
1359  PyThread_type_lock lock;
1360  __pyx_atomic_int acquisition_count[2];
1361  __pyx_atomic_int *acquisition_count_aligned_p;
1362  Py_buffer view;
1363  int flags;
1364  int dtype_is_object;
1365  __Pyx_TypeInfo *typeinfo;
1366 };
1367 
1368 
1369 /* "View.MemoryView":967
1370  *
1371  * @cname('__pyx_memoryviewslice')
1372  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1373  * "Internal class for passing memoryview slices to Python"
1374  *
1375  */
1376 struct __pyx_memoryviewslice_obj {
1377  struct __pyx_memoryview_obj __pyx_base;
1378  __Pyx_memviewslice from_slice;
1379  PyObject *from_object;
1380  PyObject *(*to_object_func)(char *);
1381  int (*to_dtype_func)(char *, PyObject *);
1382 };
1383 
1384 
1385 
1386 /* "py_c_linear_operator.pxd":23
1387  * # ===================
1388  *
1389  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1390  *
1391  * # Attributes
1392  */
1393 
1394 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1395  LongIndexType (*get_num_rows)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1396  LongIndexType (*get_num_columns)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1397  cLinearOperator<float> *(*get_linear_operator_float)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1398  cLinearOperator<double> *(*get_linear_operator_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1399  cLinearOperator<long double> *(*get_linear_operator_long_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1400  void (*dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1401  void (*transpose_dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1402 };
1403 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1404 
1405 
1406 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":32
1407  * # ==========================
1408  *
1409  * cdef class pycAffineMatrixFunction(pycLinearOperator): # <<<<<<<<<<<<<<
1410  * """
1411  * Defines a linear operator that is an affine function of a single parameter.
1412  */
1413 
1414 struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1415  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1416 };
1417 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1418 
1419 
1420 /* "View.MemoryView":106
1421  *
1422  * @cname("__pyx_array")
1423  * cdef class array: # <<<<<<<<<<<<<<
1424  *
1425  * cdef:
1426  */
1427 
1428 struct __pyx_vtabstruct_array {
1429  PyObject *(*get_memview)(struct __pyx_array_obj *);
1430 };
1431 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1432 
1433 
1434 /* "View.MemoryView":331
1435  *
1436  * @cname('__pyx_memoryview')
1437  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1438  *
1439  * cdef object obj
1440  */
1441 
1442 struct __pyx_vtabstruct_memoryview {
1443  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1444  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1445  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1446  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1447  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1448  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1449  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1450 };
1451 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1452 
1453 
1454 /* "View.MemoryView":967
1455  *
1456  * @cname('__pyx_memoryviewslice')
1457  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1458  * "Internal class for passing memoryview slices to Python"
1459  *
1460  */
1461 
1462 struct __pyx_vtabstruct__memoryviewslice {
1463  struct __pyx_vtabstruct_memoryview __pyx_base;
1464 };
1465 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1466 
1467 /* --- Runtime support code (head) --- */
1468 /* Refnanny.proto */
1469 #ifndef CYTHON_REFNANNY
1470  #define CYTHON_REFNANNY 0
1471 #endif
1472 #if CYTHON_REFNANNY
1473  typedef struct {
1474  void (*INCREF)(void*, PyObject*, int);
1475  void (*DECREF)(void*, PyObject*, int);
1476  void (*GOTREF)(void*, PyObject*, int);
1477  void (*GIVEREF)(void*, PyObject*, int);
1478  void* (*SetupContext)(const char*, int, const char*);
1479  void (*FinishContext)(void**);
1480  } __Pyx_RefNannyAPIStruct;
1481  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1482  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1483  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1484 #ifdef WITH_THREAD
1485  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1486  if (acquire_gil) {\
1487  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1488  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1489  PyGILState_Release(__pyx_gilstate_save);\
1490  } else {\
1491  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1492  }
1493 #else
1494  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1495  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1496 #endif
1497  #define __Pyx_RefNannyFinishContext()\
1498  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1499  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1500  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1501  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1502  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1503  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1504  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1505  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1506  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1507 #else
1508  #define __Pyx_RefNannyDeclarations
1509  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1510  #define __Pyx_RefNannyFinishContext()
1511  #define __Pyx_INCREF(r) Py_INCREF(r)
1512  #define __Pyx_DECREF(r) Py_DECREF(r)
1513  #define __Pyx_GOTREF(r)
1514  #define __Pyx_GIVEREF(r)
1515  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1516  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1517  #define __Pyx_XGOTREF(r)
1518  #define __Pyx_XGIVEREF(r)
1519 #endif
1520 #define __Pyx_XDECREF_SET(r, v) do {\
1521  PyObject *tmp = (PyObject *) r;\
1522  r = v; __Pyx_XDECREF(tmp);\
1523  } while (0)
1524 #define __Pyx_DECREF_SET(r, v) do {\
1525  PyObject *tmp = (PyObject *) r;\
1526  r = v; __Pyx_DECREF(tmp);\
1527  } while (0)
1528 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1529 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1530 
1531 /* PyObjectGetAttrStr.proto */
1532 #if CYTHON_USE_TYPE_SLOTS
1533 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1534 #else
1535 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1536 #endif
1537 
1538 /* GetBuiltinName.proto */
1539 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1540 
1541 /* RaiseDoubleKeywords.proto */
1542 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1543 
1544 /* ParseKeywords.proto */
1545 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1546  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1547  const char* function_name);
1548 
1549 /* RaiseArgTupleInvalid.proto */
1550 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1551  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1552 
1553 /* PyThreadStateGet.proto */
1554 #if CYTHON_FAST_THREAD_STATE
1555 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1556 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1557 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1558 #else
1559 #define __Pyx_PyThreadState_declare
1560 #define __Pyx_PyThreadState_assign
1561 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1562 #endif
1563 
1564 /* PyErrFetchRestore.proto */
1565 #if CYTHON_FAST_THREAD_STATE
1566 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1567 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1568 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1569 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1570 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1571 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1572 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1573 #if CYTHON_COMPILING_IN_CPYTHON
1574 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1575 #else
1576 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1577 #endif
1578 #else
1579 #define __Pyx_PyErr_Clear() PyErr_Clear()
1580 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1581 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1582 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1583 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1584 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1585 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1586 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1587 #endif
1588 
1589 /* Profile.proto */
1590 #ifndef CYTHON_PROFILE
1591 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1592  #define CYTHON_PROFILE 0
1593 #else
1594  #define CYTHON_PROFILE 1
1595 #endif
1596 #endif
1597 #ifndef CYTHON_TRACE_NOGIL
1598  #define CYTHON_TRACE_NOGIL 0
1599 #else
1600  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1601  #define CYTHON_TRACE 1
1602  #endif
1603 #endif
1604 #ifndef CYTHON_TRACE
1605  #define CYTHON_TRACE 0
1606 #endif
1607 #if CYTHON_TRACE
1608  #undef CYTHON_PROFILE_REUSE_FRAME
1609 #endif
1610 #ifndef CYTHON_PROFILE_REUSE_FRAME
1611  #define CYTHON_PROFILE_REUSE_FRAME 0
1612 #endif
1613 #if CYTHON_PROFILE || CYTHON_TRACE
1614  #include "compile.h"
1615  #include "frameobject.h"
1616  #include "traceback.h"
1617 #if PY_VERSION_HEX >= 0x030b00a6
1618  #ifndef Py_BUILD_CORE
1619  #define Py_BUILD_CORE 1
1620  #endif
1621  #include "internal/pycore_frame.h"
1622 #endif
1623  #if CYTHON_PROFILE_REUSE_FRAME
1624  #define CYTHON_FRAME_MODIFIER static
1625  #define CYTHON_FRAME_DEL(frame)
1626  #else
1627  #define CYTHON_FRAME_MODIFIER
1628  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1629  #endif
1630  #define __Pyx_TraceDeclarations\
1631  static PyCodeObject *__pyx_frame_code = NULL;\
1632  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1633  int __Pyx_use_tracing = 0;
1634  #define __Pyx_TraceFrameInit(codeobj)\
1635  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1636 #if PY_VERSION_HEX >= 0x030b00a2
1637  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1638  (unlikely((tstate)->cframe->use_tracing) &&\
1639  (!(check_tracing) || !(tstate)->tracing) &&\
1640  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1641  #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1642  #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1643 #elif PY_VERSION_HEX >= 0x030a00b1
1644  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1645  (unlikely((tstate)->cframe->use_tracing) &&\
1646  (!(check_tracing) || !(tstate)->tracing) &&\
1647  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1648  #define __Pyx_EnterTracing(tstate)\
1649  do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1650  #define __Pyx_LeaveTracing(tstate)\
1651  do {\
1652  tstate->tracing--;\
1653  tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1654  || tstate->c_profilefunc != NULL);\
1655  } while (0)
1656 #else
1657  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1658  (unlikely((tstate)->use_tracing) &&\
1659  (!(check_tracing) || !(tstate)->tracing) &&\
1660  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1661  #define __Pyx_EnterTracing(tstate)\
1662  do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1663  #define __Pyx_LeaveTracing(tstate)\
1664  do {\
1665  tstate->tracing--;\
1666  tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1667  || tstate->c_profilefunc != NULL);\
1668  } while (0)
1669 #endif
1670  #ifdef WITH_THREAD
1671  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1672  if (nogil) {\
1673  if (CYTHON_TRACE_NOGIL) {\
1674  PyThreadState *tstate;\
1675  PyGILState_STATE state = PyGILState_Ensure();\
1676  tstate = __Pyx_PyThreadState_Current;\
1677  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1678  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1679  }\
1680  PyGILState_Release(state);\
1681  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1682  }\
1683  } else {\
1684  PyThreadState* tstate = PyThreadState_GET();\
1685  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1686  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1687  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1688  }\
1689  }
1690  #else
1691  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1692  { PyThreadState* tstate = PyThreadState_GET();\
1693  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1694  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1695  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1696  }\
1697  }
1698  #endif
1699  #define __Pyx_TraceException()\
1700  if (likely(!__Pyx_use_tracing)); else {\
1701  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1702  if (__Pyx_IsTracing(tstate, 0, 1)) {\
1703  __Pyx_EnterTracing(tstate);\
1704  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1705  if (exc_info) {\
1706  if (CYTHON_TRACE && tstate->c_tracefunc)\
1707  tstate->c_tracefunc(\
1708  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1709  tstate->c_profilefunc(\
1710  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1711  Py_DECREF(exc_info);\
1712  }\
1713  __Pyx_LeaveTracing(tstate);\
1714  }\
1715  }
1716  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1717  PyObject *type, *value, *traceback;
1718  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1719  __Pyx_EnterTracing(tstate);
1720  if (CYTHON_TRACE && tstate->c_tracefunc)
1721  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1722  if (tstate->c_profilefunc)
1723  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1724  CYTHON_FRAME_DEL(frame);
1725  __Pyx_LeaveTracing(tstate);
1726  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1727  }
1728  #ifdef WITH_THREAD
1729  #define __Pyx_TraceReturn(result, nogil)\
1730  if (likely(!__Pyx_use_tracing)); else {\
1731  if (nogil) {\
1732  if (CYTHON_TRACE_NOGIL) {\
1733  PyThreadState *tstate;\
1734  PyGILState_STATE state = PyGILState_Ensure();\
1735  tstate = __Pyx_PyThreadState_Current;\
1736  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1737  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1738  }\
1739  PyGILState_Release(state);\
1740  }\
1741  } else {\
1742  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1743  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1744  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1745  }\
1746  }\
1747  }
1748  #else
1749  #define __Pyx_TraceReturn(result, nogil)\
1750  if (likely(!__Pyx_use_tracing)); else {\
1751  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1752  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1753  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1754  }\
1755  }
1756  #endif
1757  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1758  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1759 #else
1760  #define __Pyx_TraceDeclarations
1761  #define __Pyx_TraceFrameInit(codeobj)
1762  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1763  #define __Pyx_TraceException()
1764  #define __Pyx_TraceReturn(result, nogil)
1765 #endif
1766 #if CYTHON_TRACE
1767  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1768  int ret;
1769  PyObject *type, *value, *traceback;
1770  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1771  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1772  __Pyx_EnterTracing(tstate);
1773  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1774  __Pyx_LeaveTracing(tstate);
1775  if (likely(!ret)) {
1776  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1777  } else {
1778  Py_XDECREF(type);
1779  Py_XDECREF(value);
1780  Py_XDECREF(traceback);
1781  }
1782  return ret;
1783  }
1784  #ifdef WITH_THREAD
1785  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1786  if (likely(!__Pyx_use_tracing)); else {\
1787  if (nogil) {\
1788  if (CYTHON_TRACE_NOGIL) {\
1789  int ret = 0;\
1790  PyThreadState *tstate;\
1791  PyGILState_STATE state = PyGILState_Ensure();\
1792  tstate = __Pyx_PyThreadState_Current;\
1793  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1794  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1795  }\
1796  PyGILState_Release(state);\
1797  if (unlikely(ret)) goto_error;\
1798  }\
1799  } else {\
1800  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1801  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1802  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1803  if (unlikely(ret)) goto_error;\
1804  }\
1805  }\
1806  }
1807  #else
1808  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1809  if (likely(!__Pyx_use_tracing)); else {\
1810  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1811  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1812  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1813  if (unlikely(ret)) goto_error;\
1814  }\
1815  }
1816  #endif
1817 #else
1818  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1819 #endif
1820 
1821 /* PyObjectCall.proto */
1822 #if CYTHON_COMPILING_IN_CPYTHON
1823 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1824 #else
1825 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1826 #endif
1827 
1828 /* RaiseException.proto */
1829 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1830 
1831 /* PyIntCompare.proto */
1832 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1833 
1834 /* IncludeStringH.proto */
1835 #include <string.h>
1836 
1837 /* BytesEquals.proto */
1838 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1839 
1840 /* PyDictVersioning.proto */
1841 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1842 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1843 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1844 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1845  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1846  (cache_var) = (value);
1847 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1848  static PY_UINT64_T __pyx_dict_version = 0;\
1849  static PyObject *__pyx_dict_cached_value = NULL;\
1850  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1851  (VAR) = __pyx_dict_cached_value;\
1852  } else {\
1853  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1854  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1855  }\
1856 }
1857 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1858 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1859 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1860 #else
1861 #define __PYX_GET_DICT_VERSION(dict) (0)
1862 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1863 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1864 #endif
1865 
1866 /* GetModuleGlobalName.proto */
1867 #if CYTHON_USE_DICT_VERSIONS
1868 #define __Pyx_GetModuleGlobalName(var, name) do {\
1869  static PY_UINT64_T __pyx_dict_version = 0;\
1870  static PyObject *__pyx_dict_cached_value = NULL;\
1871  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1872  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1873  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1874 } while(0)
1875 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1876  PY_UINT64_T __pyx_dict_version;\
1877  PyObject *__pyx_dict_cached_value;\
1878  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1879 } while(0)
1880 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1881 #else
1882 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1883 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1884 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1885 #endif
1886 
1887 /* PyCFunctionFastCall.proto */
1888 #if CYTHON_FAST_PYCCALL
1889 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1890 #else
1891 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1892 #endif
1893 
1894 /* PyFunctionFastCall.proto */
1895 #if CYTHON_FAST_PYCALL
1896 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1897  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1898 #if 1 || PY_VERSION_HEX < 0x030600B1
1899 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1900 #else
1901 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1902 #endif
1903 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1904  (sizeof(char [1 - 2*!(cond)]) - 1)
1905 #ifndef Py_MEMBER_SIZE
1906 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1907 #endif
1908 #if CYTHON_FAST_PYCALL
1909  static size_t __pyx_pyframe_localsplus_offset = 0;
1910  #include "frameobject.h"
1911 #if PY_VERSION_HEX >= 0x030b00a6
1912  #ifndef Py_BUILD_CORE
1913  #define Py_BUILD_CORE 1
1914  #endif
1915  #include "internal/pycore_frame.h"
1916 #endif
1917  #define __Pxy_PyFrame_Initialize_Offsets()\
1918  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1919  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1920  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1921  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1922 #endif // CYTHON_FAST_PYCALL
1923 #endif
1924 
1925 /* PyObjectCall2Args.proto */
1926 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1927 
1928 /* PyObjectCallMethO.proto */
1929 #if CYTHON_COMPILING_IN_CPYTHON
1930 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1931 #endif
1932 
1933 /* PyObjectCallOneArg.proto */
1934 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1935 
1936 /* PyObjectCallNoArg.proto */
1937 #if CYTHON_COMPILING_IN_CPYTHON
1938 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1939 #else
1940 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1941 #endif
1942 
1943 /* GetItemInt.proto */
1944 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1945  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1946  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1947  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1948  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1949 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1950  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1951  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1952  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1953 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1954  int wraparound, int boundscheck);
1955 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1956  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1957  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1958  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1959 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1960  int wraparound, int boundscheck);
1961 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1962 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1963  int is_list, int wraparound, int boundscheck);
1964 
1965 /* DictGetItem.proto */
1966 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1967 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1968 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1969  (likely(PyDict_CheckExact(obj)) ?\
1970  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1971 #else
1972 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1973 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1974 #endif
1975 
1976 /* MemviewSliceInit.proto */
1977 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1978 #define __Pyx_MEMVIEW_DIRECT 1
1979 #define __Pyx_MEMVIEW_PTR 2
1980 #define __Pyx_MEMVIEW_FULL 4
1981 #define __Pyx_MEMVIEW_CONTIG 8
1982 #define __Pyx_MEMVIEW_STRIDED 16
1983 #define __Pyx_MEMVIEW_FOLLOW 32
1984 #define __Pyx_IS_C_CONTIG 1
1985 #define __Pyx_IS_F_CONTIG 2
1986 static int __Pyx_init_memviewslice(
1987  struct __pyx_memoryview_obj *memview,
1988  int ndim,
1989  __Pyx_memviewslice *memviewslice,
1990  int memview_is_new_reference);
1991 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1992  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1993 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1994  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1995 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1996 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1997 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1998 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1999 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2000 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2001 
2002 /* ArgTypeTest.proto */
2003 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2004  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2005  __Pyx__ArgTypeTest(obj, type, name, exact))
2006 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2007 
2008 /* UnicodeEquals.proto */
2009 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2010 
2011 /* StrEquals.proto */
2012 #if PY_MAJOR_VERSION >= 3
2013 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2014 #else
2015 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2016 #endif
2017 
2018 /* UnaryNegOverflows.proto */
2019 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2020  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2021 
2022 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2023 /* WriteUnraisableException.proto */
2024 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2025  int lineno, const char *filename,
2026  int full_traceback, int nogil);
2027 
2028 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2029 /* GetAttr.proto */
2030 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2031 
2032 /* ObjectGetItem.proto */
2033 #if CYTHON_USE_TYPE_SLOTS
2034 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2035 #else
2036 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2037 #endif
2038 
2039 /* decode_c_string_utf16.proto */
2040 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2041  int byteorder = 0;
2042  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2043 }
2044 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2045  int byteorder = -1;
2046  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2047 }
2048 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2049  int byteorder = 1;
2050  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2051 }
2052 
2053 /* decode_c_string.proto */
2054 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2055  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2056  const char* encoding, const char* errors,
2057  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2058 
2059 /* PyErrExceptionMatches.proto */
2060 #if CYTHON_FAST_THREAD_STATE
2061 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2062 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2063 #else
2064 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2065 #endif
2066 
2067 /* GetAttr3.proto */
2068 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2069 
2070 /* RaiseTooManyValuesToUnpack.proto */
2071 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2072 
2073 /* RaiseNeedMoreValuesToUnpack.proto */
2074 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2075 
2076 /* RaiseNoneIterError.proto */
2077 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2078 
2079 /* ExtTypeTest.proto */
2080 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2081 
2082 /* GetTopmostException.proto */
2083 #if CYTHON_USE_EXC_INFO_STACK
2084 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2085 #endif
2086 
2087 /* SaveResetException.proto */
2088 #if CYTHON_FAST_THREAD_STATE
2089 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2090 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2091 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2092 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2093 #else
2094 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2095 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2096 #endif
2097 
2098 /* GetException.proto */
2099 #if CYTHON_FAST_THREAD_STATE
2100 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2101 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2102 #else
2103 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2104 #endif
2105 
2106 /* SwapException.proto */
2107 #if CYTHON_FAST_THREAD_STATE
2108 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2109 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2110 #else
2111 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2112 #endif
2113 
2114 /* Import.proto */
2115 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2116 
2117 /* FastTypeChecks.proto */
2118 #if CYTHON_COMPILING_IN_CPYTHON
2119 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2120 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2121 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2122 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2123 #else
2124 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2125 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2126 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2127 #endif
2128 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2129 
2130 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2131 /* ListCompAppend.proto */
2132 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2133 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2134  PyListObject* L = (PyListObject*) list;
2135  Py_ssize_t len = Py_SIZE(list);
2136  if (likely(L->allocated > len)) {
2137  Py_INCREF(x);
2138  PyList_SET_ITEM(list, len, x);
2139  __Pyx_SET_SIZE(list, len + 1);
2140  return 0;
2141  }
2142  return PyList_Append(list, x);
2143 }
2144 #else
2145 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2146 #endif
2147 
2148 /* PyIntBinop.proto */
2149 #if !CYTHON_COMPILING_IN_PYPY
2150 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2151 #else
2152 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2153  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2154 #endif
2155 
2156 /* ListExtend.proto */
2157 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2158 #if CYTHON_COMPILING_IN_CPYTHON
2159  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2160  if (unlikely(!none))
2161  return -1;
2162  Py_DECREF(none);
2163  return 0;
2164 #else
2165  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2166 #endif
2167 }
2168 
2169 /* ListAppend.proto */
2170 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2171 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2172  PyListObject* L = (PyListObject*) list;
2173  Py_ssize_t len = Py_SIZE(list);
2174  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2175  Py_INCREF(x);
2176  PyList_SET_ITEM(list, len, x);
2177  __Pyx_SET_SIZE(list, len + 1);
2178  return 0;
2179  }
2180  return PyList_Append(list, x);
2181 }
2182 #else
2183 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2184 #endif
2185 
2186 /* AssertionsEnabled.proto */
2187 #define __Pyx_init_assertions_enabled()
2188 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2189  #define __pyx_assertions_enabled() (1)
2190 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2191  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2192 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2193  static int __pyx_assertions_enabled_flag;
2194  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2195  #undef __Pyx_init_assertions_enabled
2196  static void __Pyx_init_assertions_enabled(void) {
2197  __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2198  }
2199 #else
2200  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2201 #endif
2202 
2203 /* None.proto */
2204 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2205 
2206 /* PySequenceContains.proto */
2207 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2208  int result = PySequence_Contains(seq, item);
2209  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2210 }
2211 
2212 /* ImportFrom.proto */
2213 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2214 
2215 /* HasAttr.proto */
2216 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2217 
2218 /* CallNextTpDealloc.proto */
2219 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2220 
2221 /* CallNextTpTraverse.proto */
2222 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
2223 
2224 /* CallNextTpClear.proto */
2225 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2226 
2227 /* PyObject_GenericGetAttrNoDict.proto */
2228 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2229 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2230 #else
2231 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2232 #endif
2233 
2234 /* PyObject_GenericGetAttr.proto */
2235 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2236 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2237 #else
2238 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2239 #endif
2240 
2241 /* TypeImport.proto */
2242 #ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36
2243 #define __PYX_HAVE_RT_ImportType_proto_0_29_36
2244 #if __STDC_VERSION__ >= 201112L
2245 #include <stdalign.h>
2246 #endif
2247 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
2248 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s)
2249 #else
2250 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*)
2251 #endif
2252 enum __Pyx_ImportType_CheckSize_0_29_36 {
2253  __Pyx_ImportType_CheckSize_Error_0_29_36 = 0,
2254  __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1,
2255  __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2
2256 };
2257 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size);
2258 #endif
2259 
2260 /* GetVTable.proto */
2261 static void* __Pyx_GetVtable(PyObject *dict);
2262 
2263 /* SetVTable.proto */
2264 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2265 
2266 /* PyObjectGetAttrStrNoError.proto */
2267 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2268 
2269 /* SetupReduce.proto */
2270 static int __Pyx_setup_reduce(PyObject* type_obj);
2271 
2272 /* FetchCommonType.proto */
2273 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2274 
2275 /* CythonFunctionShared.proto */
2276 #define __Pyx_CyFunction_USED 1
2277 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2278 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2279 #define __Pyx_CYFUNCTION_CCLASS 0x04
2280 #define __Pyx_CyFunction_GetClosure(f)\
2281  (((__pyx_CyFunctionObject *) (f))->func_closure)
2282 #define __Pyx_CyFunction_GetClassObj(f)\
2283  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2284 #define __Pyx_CyFunction_Defaults(type, f)\
2285  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2286 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2287  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2288 typedef struct {
2289  PyCFunctionObject func;
2290 #if PY_VERSION_HEX < 0x030500A0
2291  PyObject *func_weakreflist;
2292 #endif
2293  PyObject *func_dict;
2294  PyObject *func_name;
2295  PyObject *func_qualname;
2296  PyObject *func_doc;
2297  PyObject *func_globals;
2298  PyObject *func_code;
2299  PyObject *func_closure;
2300  PyObject *func_classobj;
2301  void *defaults;
2302  int defaults_pyobjects;
2303  size_t defaults_size; // used by FusedFunction for copying defaults
2304  int flags;
2305  PyObject *defaults_tuple;
2306  PyObject *defaults_kwdict;
2307  PyObject *(*defaults_getter)(PyObject *);
2308  PyObject *func_annotations;
2309 } __pyx_CyFunctionObject;
2310 static PyTypeObject *__pyx_CyFunctionType = 0;
2311 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2312 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2313  int flags, PyObject* qualname,
2314  PyObject *self,
2315  PyObject *module, PyObject *globals,
2316  PyObject* code);
2317 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2318  size_t size,
2319  int pyobjects);
2320 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2321  PyObject *tuple);
2322 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2323  PyObject *dict);
2324 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2325  PyObject *dict);
2326 static int __pyx_CyFunction_init(void);
2327 
2328 /* CythonFunction.proto */
2329 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2330  int flags, PyObject* qualname,
2331  PyObject *closure,
2332  PyObject *module, PyObject *globals,
2333  PyObject* code);
2334 
2335 /* CLineInTraceback.proto */
2336 #ifdef CYTHON_CLINE_IN_TRACEBACK
2337 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2338 #else
2339 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2340 #endif
2341 
2342 /* CodeObjectCache.proto */
2343 typedef struct {
2344  PyCodeObject* code_object;
2345  int code_line;
2346 } __Pyx_CodeObjectCacheEntry;
2347 struct __Pyx_CodeObjectCache {
2348  int count;
2349  int max_count;
2350  __Pyx_CodeObjectCacheEntry* entries;
2351 };
2352 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2353 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2354 static PyCodeObject *__pyx_find_code_object(int code_line);
2355 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2356 
2357 /* AddTraceback.proto */
2358 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2359  int py_line, const char *filename);
2360 
2361 #if PY_MAJOR_VERSION < 3
2362  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2363  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2364 #else
2365  #define __Pyx_GetBuffer PyObject_GetBuffer
2366  #define __Pyx_ReleaseBuffer PyBuffer_Release
2367 #endif
2368 
2369 
2370 /* BufferStructDeclare.proto */
2371 typedef struct {
2372  Py_ssize_t shape, strides, suboffsets;
2373 } __Pyx_Buf_DimInfo;
2374 typedef struct {
2375  size_t refcount;
2376  Py_buffer pybuffer;
2377 } __Pyx_Buffer;
2378 typedef struct {
2379  __Pyx_Buffer *rcbuffer;
2380  char *data;
2381  __Pyx_Buf_DimInfo diminfo[8];
2382 } __Pyx_LocalBuf_ND;
2383 
2384 /* MemviewSliceIsContig.proto */
2385 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2386 
2387 /* OverlappingSlices.proto */
2388 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2389  __Pyx_memviewslice *slice2,
2390  int ndim, size_t itemsize);
2391 
2392 /* Capsule.proto */
2393 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2394 
2395 /* GCCDiagnostics.proto */
2396 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2397 #define __Pyx_HAS_GCC_DIAGNOSTIC
2398 #endif
2399 
2400 /* IsLittleEndian.proto */
2401 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2402 
2403 /* BufferFormatCheck.proto */
2404 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2405 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2406  __Pyx_BufFmt_StackElem* stack,
2407  __Pyx_TypeInfo* type);
2408 
2409 /* TypeInfoCompare.proto */
2410 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2411 
2412 /* MemviewSliceValidateAndInit.proto */
2413 static int __Pyx_ValidateAndInit_memviewslice(
2414  int *axes_specs,
2415  int c_or_f_flag,
2416  int buf_flags,
2417  int ndim,
2418  __Pyx_TypeInfo *dtype,
2419  __Pyx_BufFmt_StackElem stack[],
2420  __Pyx_memviewslice *memviewslice,
2421  PyObject *original_obj);
2422 
2423 /* ObjectToMemviewSlice.proto */
2424 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *, int writable_flag);
2425 
2426 /* ObjectToMemviewSlice.proto */
2427 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *, int writable_flag);
2428 
2429 /* CppExceptionConversion.proto */
2430 #ifndef __Pyx_CppExn2PyErr
2431 #include <new>
2432 #include <typeinfo>
2433 #include <stdexcept>
2434 #include <ios>
2435 static void __Pyx_CppExn2PyErr() {
2436  try {
2437  if (PyErr_Occurred())
2438  ; // let the latest Python exn pass through and ignore the current one
2439  else
2440  throw;
2441  } catch (const std::bad_alloc& exn) {
2442  PyErr_SetString(PyExc_MemoryError, exn.what());
2443  } catch (const std::bad_cast& exn) {
2444  PyErr_SetString(PyExc_TypeError, exn.what());
2445  } catch (const std::bad_typeid& exn) {
2446  PyErr_SetString(PyExc_TypeError, exn.what());
2447  } catch (const std::domain_error& exn) {
2448  PyErr_SetString(PyExc_ValueError, exn.what());
2449  } catch (const std::invalid_argument& exn) {
2450  PyErr_SetString(PyExc_ValueError, exn.what());
2451  } catch (const std::ios_base::failure& exn) {
2452  PyErr_SetString(PyExc_IOError, exn.what());
2453  } catch (const std::out_of_range& exn) {
2454  PyErr_SetString(PyExc_IndexError, exn.what());
2455  } catch (const std::overflow_error& exn) {
2456  PyErr_SetString(PyExc_OverflowError, exn.what());
2457  } catch (const std::range_error& exn) {
2458  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2459  } catch (const std::underflow_error& exn) {
2460  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2461  } catch (const std::exception& exn) {
2462  PyErr_SetString(PyExc_RuntimeError, exn.what());
2463  }
2464  catch (...)
2465  {
2466  PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
2467  }
2468 }
2469 #endif
2470 
2471 /* ObjectToMemviewSlice.proto */
2472 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
2473 
2474 /* ObjectToMemviewSlice.proto */
2475 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *, int writable_flag);
2476 
2477 /* ObjectToMemviewSlice.proto */
2478 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *, int writable_flag);
2479 
2480 /* ObjectToMemviewSlice.proto */
2481 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *, int writable_flag);
2482 
2483 /* ObjectToMemviewSlice.proto */
2484 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);
2485 
2486 /* ObjectToMemviewSlice.proto */
2487 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2488 
2489 /* ObjectToMemviewSlice.proto */
2490 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2491 
2492 /* ObjectToMemviewSlice.proto */
2493 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *, int writable_flag);
2494 
2495 /* MemviewSliceCopyTemplate.proto */
2496 static __Pyx_memviewslice
2497 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2498  const char *mode, int ndim,
2499  size_t sizeof_dtype, int contig_flag,
2500  int dtype_is_object);
2501 
2502 /* CIntToPy.proto */
2503 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2504 
2505 /* CIntFromPy.proto */
2506 static CYTHON_INLINE LongIndexType __Pyx_PyInt_As_LongIndexType(PyObject *);
2507 
2508 /* CIntFromPy.proto */
2509 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2510 
2511 /* CIntFromPy.proto */
2512 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2513 
2514 /* CIntToPy.proto */
2515 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2516 
2517 /* CIntFromPy.proto */
2518 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2519 
2520 /* CheckBinaryVersion.proto */
2521 static int __Pyx_check_binary_version(void);
2522 
2523 /* InitStrings.proto */
2524 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2525 
2526 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2527 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2528 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2529 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2530 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2531 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2532 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2533 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2534 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2535 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2536 
2537 /* Module declarations from 'imate._definitions.types' */
2538 
2539 /* Module declarations from 'imate._c_linear_operator.c_linear_operator' */
2540 
2541 /* Module declarations from 'imate._c_linear_operator.py_c_linear_operator' */
2542 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2543 
2544 /* Module declarations from 'imate._c_linear_operator.c_affine_matrix_function' */
2545 
2546 /* Module declarations from 'imate._c_linear_operator.c_dense_affine_matrix_function' */
2547 
2548 /* Module declarations from 'imate._c_linear_operator.c_csr_affine_matrix_function' */
2549 
2550 /* Module declarations from 'imate._c_linear_operator.c_csc_affine_matrix_function' */
2551 
2552 /* Module declarations from 'imate._c_linear_operator.py_c_affine_matrix_function' */
2553 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = 0;
2554 static PyTypeObject *__pyx_array_type = 0;
2555 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2556 static PyTypeObject *__pyx_memoryview_type = 0;
2557 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2558 static PyObject *generic = 0;
2559 static PyObject *strided = 0;
2560 static PyObject *indirect = 0;
2561 static PyObject *contiguous = 0;
2562 static PyObject *indirect_contiguous = 0;
2563 static int __pyx_memoryview_thread_locks_used;
2564 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2565 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2566 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2567 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2568 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2569 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2570 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2571 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2572 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2573 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2574 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2575 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2576 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2577 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2578 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2579 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2580 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2581 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2582 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2583 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2584 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2585 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2586 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2587 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2588 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2589 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2590 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2591 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2592 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2593 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2594 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2595 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2596 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2597 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2598 static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
2599 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2600 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = { "long double", NULL, sizeof(long double), { 0 }, 0, 'R', 0, 0 };
2601 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2602 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_affine_matrix_function"
2603 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function;
2604 int __pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function = 0;
2605 
2606 /* Implementation of 'imate._c_linear_operator.py_c_affine_matrix_function' */
2607 static PyObject *__pyx_builtin_ValueError;
2608 static PyObject *__pyx_builtin_TypeError;
2609 static PyObject *__pyx_builtin_MemoryError;
2610 static PyObject *__pyx_builtin_enumerate;
2611 static PyObject *__pyx_builtin_range;
2612 static PyObject *__pyx_builtin_Ellipsis;
2613 static PyObject *__pyx_builtin_id;
2614 static PyObject *__pyx_builtin_IndexError;
2615 static const char __pyx_k_A[] = "A";
2616 static const char __pyx_k_B[] = "B";
2617 static const char __pyx_k_O[] = "O";
2618 static const char __pyx_k_c[] = "c";
2619 static const char __pyx_k_id[] = "id";
2620 static const char __pyx_k_new[] = "__new__";
2621 static const char __pyx_k_obj[] = "obj";
2622 static const char __pyx_k_base[] = "base";
2623 static const char __pyx_k_copy[] = "copy";
2624 static const char __pyx_k_data[] = "data";
2625 static const char __pyx_k_dict[] = "__dict__";
2626 static const char __pyx_k_main[] = "__main__";
2627 static const char __pyx_k_mode[] = "mode";
2628 static const char __pyx_k_name[] = "name";
2629 static const char __pyx_k_ndim[] = "ndim";
2630 static const char __pyx_k_pack[] = "pack";
2631 static const char __pyx_k_self[] = "self";
2632 static const char __pyx_k_size[] = "size";
2633 static const char __pyx_k_step[] = "step";
2634 static const char __pyx_k_stop[] = "stop";
2635 static const char __pyx_k_test[] = "__test__";
2636 static const char __pyx_k_ASCII[] = "ASCII";
2637 static const char __pyx_k_class[] = "__class__";
2638 static const char __pyx_k_dtype[] = "dtype";
2639 static const char __pyx_k_error[] = "error";
2640 static const char __pyx_k_flags[] = "flags";
2641 static const char __pyx_k_numpy[] = "numpy";
2642 static const char __pyx_k_range[] = "range";
2643 static const char __pyx_k_shape[] = "shape";
2644 static const char __pyx_k_start[] = "start";
2645 static const char __pyx_k_A_data[] = "A_data";
2646 static const char __pyx_k_B_data[] = "B_data";
2647 static const char __pyx_k_astype[] = "astype";
2648 static const char __pyx_k_encode[] = "encode";
2649 static const char __pyx_k_format[] = "format";
2650 static const char __pyx_k_import[] = "__import__";
2651 static const char __pyx_k_indptr[] = "indptr";
2652 static const char __pyx_k_name_2[] = "__name__";
2653 static const char __pyx_k_pickle[] = "pickle";
2654 static const char __pyx_k_reduce[] = "__reduce__";
2655 static const char __pyx_k_struct[] = "struct";
2656 static const char __pyx_k_unpack[] = "unpack";
2657 static const char __pyx_k_update[] = "update";
2658 static const char __pyx_k_float32[] = "float32";
2659 static const char __pyx_k_float64[] = "float64";
2660 static const char __pyx_k_fortran[] = "fortran";
2661 static const char __pyx_k_indices[] = "indices";
2662 static const char __pyx_k_memview[] = "memview";
2663 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2664 static const char __pyx_k_float128[] = "float128";
2665 static const char __pyx_k_getstate[] = "__getstate__";
2666 static const char __pyx_k_issparse[] = "issparse";
2667 static const char __pyx_k_itemsize[] = "itemsize";
2668 static const char __pyx_k_pyx_type[] = "__pyx_type";
2669 static const char __pyx_k_setstate[] = "__setstate__";
2670 static const char __pyx_k_A_data_mv[] = "A_data_mv";
2671 static const char __pyx_k_A_indices[] = "A_indices";
2672 static const char __pyx_k_B_data_mv[] = "B_data_mv";
2673 static const char __pyx_k_B_indices[] = "B_indices";
2674 static const char __pyx_k_TypeError[] = "TypeError";
2675 static const char __pyx_k_enumerate[] = "enumerate";
2676 static const char __pyx_k_pyx_state[] = "__pyx_state";
2677 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2678 static const char __pyx_k_A_num_rows[] = "A_num_rows";
2679 static const char __pyx_k_IndexError[] = "IndexError";
2680 static const char __pyx_k_ValueError[] = "ValueError";
2681 static const char __pyx_k_csr_matrix[] = "csr_matrix";
2682 static const char __pyx_k_pyx_result[] = "__pyx_result";
2683 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2684 static const char __pyx_k_A_data_mv_c[] = "A_data_mv_c";
2685 static const char __pyx_k_A_data_mv_f[] = "A_data_mv_f";
2686 static const char __pyx_k_B_data_mv_c[] = "B_data_mv_c";
2687 static const char __pyx_k_B_data_mv_f[] = "B_data_mv_f";
2688 static const char __pyx_k_MemoryError[] = "MemoryError";
2689 static const char __pyx_k_PickleError[] = "PickleError";
2690 static const char __pyx_k_A_indices_mv[] = "A_indices_mv";
2691 static const char __pyx_k_B_indices_mv[] = "B_indices_mv";
2692 static const char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
2693 static const char __pyx_k_F_CONTIGUOUS[] = "F_CONTIGUOUS";
2694 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2695 static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
2696 static const char __pyx_k_sort_indices[] = "sort_indices";
2697 static const char __pyx_k_stringsource[] = "stringsource";
2698 static const char __pyx_k_A_num_columns[] = "A_num_columns";
2699 static const char __pyx_k_B_is_identity[] = "B_is_identity";
2700 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2701 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2702 static const char __pyx_k_A_is_row_major[] = "A_is_row_major";
2703 static const char __pyx_k_B_is_row_major[] = "B_is_row_major";
2704 static const char __pyx_k_isspmatrix_csc[] = "isspmatrix_csc";
2705 static const char __pyx_k_isspmatrix_csr[] = "isspmatrix_csr";
2706 static const char __pyx_k_A_index_pointer[] = "A_index_pointer";
2707 static const char __pyx_k_B_index_pointer[] = "B_index_pointer";
2708 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2709 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2710 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2711 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2712 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2713 static const char __pyx_k_A_cannot_be_None[] = "A cannot be None.";
2714 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2715 static const char __pyx_k_A_index_pointer_mv[] = "A_index_pointer_mv";
2716 static const char __pyx_k_B_index_pointer_mv[] = "B_index_pointer_mv";
2717 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2718 static const char __pyx_k_has_sorted_indices[] = "has_sorted_indices";
2719 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2720 static const char __pyx_k_set_csc_matrix_float[] = "set_csc_matrix_float";
2721 static const char __pyx_k_set_csr_matrix_float[] = "set_csr_matrix_float";
2722 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2723 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2724 static const char __pyx_k_set_csc_matrix_double[] = "set_csc_matrix_double";
2725 static const char __pyx_k_set_csr_matrix_double[] = "set_csr_matrix_double";
2726 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2727 static const char __pyx_k_set_dense_matrix_float[] = "set_dense_matrix_float";
2728 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2729 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2730 static const char __pyx_k_pycAffineMatrixFunction[] = "pycAffineMatrixFunction";
2731 static const char __pyx_k_set_dense_matrix_double[] = "set_dense_matrix_double";
2732 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2733 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2734 static const char __pyx_k_set_csc_matrix_long_double[] = "set_csc_matrix_long_double";
2735 static const char __pyx_k_set_csr_matrix_long_double[] = "set_csr_matrix_long_double";
2736 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2737 static const char __pyx_k_set_dense_matrix_long_double[] = "set_dense_matrix_long_double";
2738 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2739 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2740 static const char __pyx_k_pycAffineMatrixFunction_set_csc[] = "pycAffineMatrixFunction.set_csc_matrix_float";
2741 static const char __pyx_k_pycAffineMatrixFunction_set_csr[] = "pycAffineMatrixFunction.set_csr_matrix_float";
2742 static const char __pyx_k_A_and_B_should_have_similar_data[] = "A and B should have similar data types.";
2743 static const char __pyx_k_A_and_B_should_have_the_same_sha[] = "A and B should have the same shape.";
2744 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2745 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2746 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2747 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2748 static const char __pyx_k_Data_type_should_be_float32_floa[] = "Data type should be float32, float64, or float128.";
2749 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2750 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2751 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2752 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] = "Input matrix should be a 2-dimensional array.";
2753 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2754 static const char __pyx_k_Matrices_A_and_B_should_have_sim[] = "Matrices A and B should have similar types.";
2755 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] = "Matrix A should be either C or F contiguous.";
2756 static const char __pyx_k_Matrix_B_should_be_either_C_or_F[] = "Matrix B should be either C or F contiguous.";
2757 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2758 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2759 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2760 static const char __pyx_k_imate__c_linear_operator_py_c_af[] = "imate/_c_linear_operator/py_c_affine_matrix_function.pyx";
2761 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2762 static const char __pyx_k_pycAffineMatrixFunction___reduce[] = "pycAffineMatrixFunction.__reduce_cython__";
2763 static const char __pyx_k_pycAffineMatrixFunction___setsta[] = "pycAffineMatrixFunction.__setstate_cython__";
2764 static const char __pyx_k_pycAffineMatrixFunction_set_dens[] = "pycAffineMatrixFunction.set_dense_matrix_float";
2765 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2766 static const char __pyx_k_pycAffineMatrixFunction_set_csc_2[] = "pycAffineMatrixFunction.set_csc_matrix_double";
2767 static const char __pyx_k_pycAffineMatrixFunction_set_csc_3[] = "pycAffineMatrixFunction.set_csc_matrix_long_double";
2768 static const char __pyx_k_pycAffineMatrixFunction_set_csr_2[] = "pycAffineMatrixFunction.set_csr_matrix_double";
2769 static const char __pyx_k_pycAffineMatrixFunction_set_csr_3[] = "pycAffineMatrixFunction.set_csr_matrix_long_double";
2770 static const char __pyx_k_imate__c_linear_operator_py_c_af_2[] = "imate._c_linear_operator.py_c_affine_matrix_function";
2771 static const char __pyx_k_pycAffineMatrixFunction_set_dens_2[] = "pycAffineMatrixFunction.set_dense_matrix_double";
2772 static const char __pyx_k_pycAffineMatrixFunction_set_dens_3[] = "pycAffineMatrixFunction.set_dense_matrix_long_double";
2773 static PyObject *__pyx_n_s_A;
2774 static PyObject *__pyx_n_s_ASCII;
2775 static PyObject *__pyx_kp_u_A_and_B_should_have_similar_data;
2776 static PyObject *__pyx_kp_u_A_and_B_should_have_the_same_sha;
2777 static PyObject *__pyx_kp_u_A_cannot_be_None;
2778 static PyObject *__pyx_n_s_A_data;
2779 static PyObject *__pyx_n_s_A_data_mv;
2780 static PyObject *__pyx_n_s_A_data_mv_c;
2781 static PyObject *__pyx_n_s_A_data_mv_f;
2782 static PyObject *__pyx_n_s_A_index_pointer;
2783 static PyObject *__pyx_n_s_A_index_pointer_mv;
2784 static PyObject *__pyx_n_s_A_indices;
2785 static PyObject *__pyx_n_s_A_indices_mv;
2786 static PyObject *__pyx_n_s_A_is_row_major;
2787 static PyObject *__pyx_n_s_A_num_columns;
2788 static PyObject *__pyx_n_s_A_num_rows;
2789 static PyObject *__pyx_n_s_B;
2790 static PyObject *__pyx_n_s_B_data;
2791 static PyObject *__pyx_n_s_B_data_mv;
2792 static PyObject *__pyx_n_s_B_data_mv_c;
2793 static PyObject *__pyx_n_s_B_data_mv_f;
2794 static PyObject *__pyx_n_s_B_index_pointer;
2795 static PyObject *__pyx_n_s_B_index_pointer_mv;
2796 static PyObject *__pyx_n_s_B_indices;
2797 static PyObject *__pyx_n_s_B_indices_mv;
2798 static PyObject *__pyx_n_s_B_is_identity;
2799 static PyObject *__pyx_n_s_B_is_row_major;
2800 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2801 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2802 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2803 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2804 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2805 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2806 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2807 static PyObject *__pyx_n_s_Ellipsis;
2808 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2809 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2810 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2811 static PyObject *__pyx_n_s_IndexError;
2812 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2813 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2814 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2815 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2816 static PyObject *__pyx_kp_u_Matrices_A_and_B_should_have_sim;
2817 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2818 static PyObject *__pyx_kp_u_Matrix_B_should_be_either_C_or_F;
2819 static PyObject *__pyx_n_s_MemoryError;
2820 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2821 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2822 static PyObject *__pyx_n_b_O;
2823 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2824 static PyObject *__pyx_n_s_PickleError;
2825 static PyObject *__pyx_n_s_TypeError;
2826 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2827 static PyObject *__pyx_n_s_ValueError;
2828 static PyObject *__pyx_n_s_View_MemoryView;
2829 static PyObject *__pyx_n_s_allocate_buffer;
2830 static PyObject *__pyx_n_s_astype;
2831 static PyObject *__pyx_n_s_base;
2832 static PyObject *__pyx_n_s_c;
2833 static PyObject *__pyx_n_u_c;
2834 static PyObject *__pyx_n_s_class;
2835 static PyObject *__pyx_n_s_cline_in_traceback;
2836 static PyObject *__pyx_kp_s_contiguous_and_direct;
2837 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2838 static PyObject *__pyx_n_s_copy;
2839 static PyObject *__pyx_n_s_csr_matrix;
2840 static PyObject *__pyx_n_s_data;
2841 static PyObject *__pyx_n_s_dict;
2842 static PyObject *__pyx_n_s_dtype;
2843 static PyObject *__pyx_n_s_dtype_is_object;
2844 static PyObject *__pyx_n_s_encode;
2845 static PyObject *__pyx_n_s_enumerate;
2846 static PyObject *__pyx_n_s_error;
2847 static PyObject *__pyx_n_s_flags;
2848 static PyObject *__pyx_n_b_float128;
2849 static PyObject *__pyx_n_b_float32;
2850 static PyObject *__pyx_n_b_float64;
2851 static PyObject *__pyx_n_s_format;
2852 static PyObject *__pyx_n_s_fortran;
2853 static PyObject *__pyx_n_u_fortran;
2854 static PyObject *__pyx_n_s_getstate;
2855 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2856 static PyObject *__pyx_n_s_has_sorted_indices;
2857 static PyObject *__pyx_n_s_id;
2858 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_af;
2859 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_af_2;
2860 static PyObject *__pyx_n_s_import;
2861 static PyObject *__pyx_n_s_indices;
2862 static PyObject *__pyx_n_s_indptr;
2863 static PyObject *__pyx_n_s_issparse;
2864 static PyObject *__pyx_n_s_isspmatrix_csc;
2865 static PyObject *__pyx_n_s_isspmatrix_csr;
2866 static PyObject *__pyx_n_s_itemsize;
2867 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2868 static PyObject *__pyx_n_s_main;
2869 static PyObject *__pyx_n_s_memview;
2870 static PyObject *__pyx_n_s_mode;
2871 static PyObject *__pyx_n_s_name;
2872 static PyObject *__pyx_n_s_name_2;
2873 static PyObject *__pyx_n_s_ndim;
2874 static PyObject *__pyx_n_s_new;
2875 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2876 static PyObject *__pyx_n_s_numpy;
2877 static PyObject *__pyx_n_s_obj;
2878 static PyObject *__pyx_n_s_pack;
2879 static PyObject *__pyx_n_s_pickle;
2880 static PyObject *__pyx_n_s_pycAffineMatrixFunction;
2881 static PyObject *__pyx_n_s_pycAffineMatrixFunction___reduce;
2882 static PyObject *__pyx_n_s_pycAffineMatrixFunction___setsta;
2883 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc;
2884 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc_2;
2885 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc_3;
2886 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr;
2887 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr_2;
2888 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr_3;
2889 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens;
2890 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens_2;
2891 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens_3;
2892 static PyObject *__pyx_n_s_pyx_PickleError;
2893 static PyObject *__pyx_n_s_pyx_checksum;
2894 static PyObject *__pyx_n_s_pyx_getbuffer;
2895 static PyObject *__pyx_n_s_pyx_result;
2896 static PyObject *__pyx_n_s_pyx_state;
2897 static PyObject *__pyx_n_s_pyx_type;
2898 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2899 static PyObject *__pyx_n_s_pyx_vtable;
2900 static PyObject *__pyx_n_s_range;
2901 static PyObject *__pyx_n_s_reduce;
2902 static PyObject *__pyx_n_s_reduce_cython;
2903 static PyObject *__pyx_n_s_reduce_ex;
2904 static PyObject *__pyx_n_s_scipy_sparse;
2905 static PyObject *__pyx_n_s_self;
2906 static PyObject *__pyx_n_s_set_csc_matrix_double;
2907 static PyObject *__pyx_n_s_set_csc_matrix_float;
2908 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2909 static PyObject *__pyx_n_s_set_csr_matrix_double;
2910 static PyObject *__pyx_n_s_set_csr_matrix_float;
2911 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2912 static PyObject *__pyx_n_s_set_dense_matrix_double;
2913 static PyObject *__pyx_n_s_set_dense_matrix_float;
2914 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2915 static PyObject *__pyx_n_s_setstate;
2916 static PyObject *__pyx_n_s_setstate_cython;
2917 static PyObject *__pyx_n_s_shape;
2918 static PyObject *__pyx_n_s_size;
2919 static PyObject *__pyx_n_s_sort_indices;
2920 static PyObject *__pyx_n_s_start;
2921 static PyObject *__pyx_n_s_step;
2922 static PyObject *__pyx_n_s_stop;
2923 static PyObject *__pyx_kp_s_strided_and_direct;
2924 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2925 static PyObject *__pyx_kp_s_strided_and_indirect;
2926 static PyObject *__pyx_kp_s_stringsource;
2927 static PyObject *__pyx_n_s_struct;
2928 static PyObject *__pyx_n_s_test;
2929 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2930 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2931 static PyObject *__pyx_n_s_unpack;
2932 static PyObject *__pyx_n_s_update;
2933 static int __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B); /* proto */
2934 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2935 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2936 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2937 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2938 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2939 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2940 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2941 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2942 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2943 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self); /* proto */
2944 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2945 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2946 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2947 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2948 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2949 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2950 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2951 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2952 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2953 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2954 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2955 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2956 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2957 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2958 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2959 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2960 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2961 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2962 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2963 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2964 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2965 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2966 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2967 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2968 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2969 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2970 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2971 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2972 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2973 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2974 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2975 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2976 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2977 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2978 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2979 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2980 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2981 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2982 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2983 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2984 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2985 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2986 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2987 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2988 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2989 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2990 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2991 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2992 static PyObject *__pyx_int_0;
2993 static PyObject *__pyx_int_1;
2994 static PyObject *__pyx_int_2;
2995 static PyObject *__pyx_int_112105877;
2996 static PyObject *__pyx_int_136983863;
2997 static PyObject *__pyx_int_184977713;
2998 static PyObject *__pyx_int_neg_1;
2999 static PyObject *__pyx_tuple_;
3000 static PyObject *__pyx_tuple__2;
3001 static PyObject *__pyx_tuple__3;
3002 static PyObject *__pyx_tuple__4;
3003 static PyObject *__pyx_tuple__5;
3004 static PyObject *__pyx_tuple__6;
3005 static PyObject *__pyx_tuple__8;
3006 static PyObject *__pyx_tuple__9;
3007 static PyObject *__pyx_slice__36;
3008 static PyObject *__pyx_tuple__19;
3009 static PyObject *__pyx_tuple__21;
3010 static PyObject *__pyx_tuple__22;
3011 static PyObject *__pyx_tuple__23;
3012 static PyObject *__pyx_tuple__24;
3013 static PyObject *__pyx_tuple__25;
3014 static PyObject *__pyx_tuple__26;
3015 static PyObject *__pyx_tuple__27;
3016 static PyObject *__pyx_tuple__28;
3017 static PyObject *__pyx_tuple__29;
3018 static PyObject *__pyx_tuple__30;
3019 static PyObject *__pyx_tuple__31;
3020 static PyObject *__pyx_tuple__32;
3021 static PyObject *__pyx_tuple__33;
3022 static PyObject *__pyx_tuple__34;
3023 static PyObject *__pyx_tuple__35;
3024 static PyObject *__pyx_tuple__37;
3025 static PyObject *__pyx_tuple__38;
3026 static PyObject *__pyx_tuple__39;
3027 static PyObject *__pyx_tuple__41;
3028 static PyObject *__pyx_tuple__42;
3029 static PyObject *__pyx_tuple__43;
3030 static PyObject *__pyx_tuple__44;
3031 static PyObject *__pyx_tuple__45;
3032 static PyObject *__pyx_tuple__46;
3033 static PyObject *__pyx_tuple__47;
3034 static PyObject *__pyx_tuple__48;
3035 static PyObject *__pyx_tuple__49;
3036 static PyObject *__pyx_tuple__50;
3037 static PyObject *__pyx_tuple__51;
3038 static PyObject *__pyx_tuple__52;
3039 static PyObject *__pyx_tuple__53;
3040 static PyObject *__pyx_tuple__54;
3041 static PyObject *__pyx_tuple__55;
3042 static PyObject *__pyx_tuple__56;
3043 static PyObject *__pyx_tuple__57;
3044 static PyObject *__pyx_tuple__58;
3045 static PyObject *__pyx_codeobj__7;
3046 static PyObject *__pyx_codeobj__10;
3047 static PyObject *__pyx_codeobj__11;
3048 static PyObject *__pyx_codeobj__12;
3049 static PyObject *__pyx_codeobj__13;
3050 static PyObject *__pyx_codeobj__14;
3051 static PyObject *__pyx_codeobj__15;
3052 static PyObject *__pyx_codeobj__16;
3053 static PyObject *__pyx_codeobj__17;
3054 static PyObject *__pyx_codeobj__18;
3055 static PyObject *__pyx_codeobj__20;
3056 static PyObject *__pyx_codeobj__40;
3057 /* Late includes */
3058 
3059 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":172
3060  * # =========
3061  *
3062  * def __cinit__(self, A, B=None): # <<<<<<<<<<<<<<
3063  * """
3064  * Sets matrices A and B.
3065  */
3066 
3067 /* Python wrapper */
3068 static int __pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3069 static int __pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3070  PyObject *__pyx_v_A = 0;
3071  PyObject *__pyx_v_B = 0;
3072  int __pyx_lineno = 0;
3073  const char *__pyx_filename = NULL;
3074  int __pyx_clineno = 0;
3075  int __pyx_r;
3076  __Pyx_RefNannyDeclarations
3077  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3078  {
3079  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,0};
3080  PyObject* values[2] = {0,0};
3081  values[1] = ((PyObject *)Py_None);
3082  if (unlikely(__pyx_kwds)) {
3083  Py_ssize_t kw_args;
3084  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3085  switch (pos_args) {
3086  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3087  CYTHON_FALLTHROUGH;
3088  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3089  CYTHON_FALLTHROUGH;
3090  case 0: break;
3091  default: goto __pyx_L5_argtuple_error;
3092  }
3093  kw_args = PyDict_Size(__pyx_kwds);
3094  switch (pos_args) {
3095  case 0:
3096  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3097  else goto __pyx_L5_argtuple_error;
3098  CYTHON_FALLTHROUGH;
3099  case 1:
3100  if (kw_args > 0) {
3101  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B);
3102  if (value) { values[1] = value; kw_args--; }
3103  }
3104  }
3105  if (unlikely(kw_args > 0)) {
3106  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 172, __pyx_L3_error)
3107  }
3108  } else {
3109  switch (PyTuple_GET_SIZE(__pyx_args)) {
3110  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3111  CYTHON_FALLTHROUGH;
3112  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3113  break;
3114  default: goto __pyx_L5_argtuple_error;
3115  }
3116  }
3117  __pyx_v_A = values[0];
3118  __pyx_v_B = values[1];
3119  }
3120  goto __pyx_L4_argument_unpacking_done;
3121  __pyx_L5_argtuple_error:;
3122  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 172, __pyx_L3_error)
3123  __pyx_L3_error:;
3124  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3125  __Pyx_RefNannyFinishContext();
3126  return -1;
3127  __pyx_L4_argument_unpacking_done:;
3128  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B);
3129 
3130  /* function exit code */
3131  __Pyx_RefNannyFinishContext();
3132  return __pyx_r;
3133 }
3134 
3135 static int __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B) {
3136  int __pyx_v_B_is_identity;
3137  int __pyx_r;
3138  __Pyx_TraceDeclarations
3139  __Pyx_RefNannyDeclarations
3140  int __pyx_t_1;
3141  int __pyx_t_2;
3142  PyObject *__pyx_t_3 = NULL;
3143  PyObject *__pyx_t_4 = NULL;
3144  PyObject *__pyx_t_5 = NULL;
3145  int __pyx_t_6;
3146  PyObject *__pyx_t_7 = NULL;
3147  int __pyx_t_8;
3148  PyObject *__pyx_t_9 = NULL;
3149  int __pyx_lineno = 0;
3150  const char *__pyx_filename = NULL;
3151  int __pyx_clineno = 0;
3152  __Pyx_RefNannySetupContext("__cinit__", 0);
3153  __Pyx_TraceCall("__cinit__", __pyx_f[0], 172, 0, __PYX_ERR(0, 172, __pyx_L1_error));
3154 
3155  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":178
3156  *
3157  * # Check A
3158  * if A is None: # <<<<<<<<<<<<<<
3159  * raise ValueError('A cannot be None.')
3160  *
3161  */
3162  __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
3163  __pyx_t_1 = (__pyx_v_A == Py_None);
3164  __pyx_t_2 = (__pyx_t_1 != 0);
3165  if (unlikely(__pyx_t_2)) {
3166 
3167  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":179
3168  * # Check A
3169  * if A is None:
3170  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
3171  *
3172  * if A.ndim != 2:
3173  */
3174  __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
3175  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
3176  __Pyx_GOTREF(__pyx_t_3);
3177  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3178  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3179  __PYX_ERR(0, 179, __pyx_L1_error)
3180 
3181  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":178
3182  *
3183  * # Check A
3184  * if A is None: # <<<<<<<<<<<<<<
3185  * raise ValueError('A cannot be None.')
3186  *
3187  */
3188  }
3189 
3190  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":181
3191  * raise ValueError('A cannot be None.')
3192  *
3193  * if A.ndim != 2: # <<<<<<<<<<<<<<
3194  * raise ValueError('Input matrix should be a 2-dimensional array.')
3195  *
3196  */
3197  __Pyx_TraceLine(181,0,__PYX_ERR(0, 181, __pyx_L1_error))
3198  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
3199  __Pyx_GOTREF(__pyx_t_3);
3200  __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
3201  __Pyx_GOTREF(__pyx_t_4);
3202  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3203  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
3204  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3205  if (unlikely(__pyx_t_2)) {
3206 
3207  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":182
3208  *
3209  * if A.ndim != 2:
3210  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
3211  *
3212  * # Data type
3213  */
3214  __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error))
3215  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
3216  __Pyx_GOTREF(__pyx_t_4);
3217  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3218  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3219  __PYX_ERR(0, 182, __pyx_L1_error)
3220 
3221  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":181
3222  * raise ValueError('A cannot be None.')
3223  *
3224  * if A.ndim != 2: # <<<<<<<<<<<<<<
3225  * raise ValueError('Input matrix should be a 2-dimensional array.')
3226  *
3227  */
3228  }
3229 
3230  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":185
3231  *
3232  * # Data type
3233  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
3234  * self.data_type_name = b'float32'
3235  * elif A.dtype == b'float64':
3236  */
3237  __Pyx_TraceLine(185,0,__PYX_ERR(0, 185, __pyx_L1_error))
3238  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
3239  __Pyx_GOTREF(__pyx_t_4);
3240  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
3241  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3242  if (__pyx_t_2) {
3243 
3244  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":186
3245  * # Data type
3246  * if A.dtype == b'float32':
3247  * self.data_type_name = b'float32' # <<<<<<<<<<<<<<
3248  * elif A.dtype == b'float64':
3249  * self.data_type_name = b'float64'
3250  */
3251  __Pyx_TraceLine(186,0,__PYX_ERR(0, 186, __pyx_L1_error))
3252  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float32");
3253 
3254  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":185
3255  *
3256  * # Data type
3257  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
3258  * self.data_type_name = b'float32'
3259  * elif A.dtype == b'float64':
3260  */
3261  goto __pyx_L5;
3262  }
3263 
3264  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":187
3265  * if A.dtype == b'float32':
3266  * self.data_type_name = b'float32'
3267  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3268  * self.data_type_name = b'float64'
3269  * elif A.dtype == b'float128':
3270  */
3271  __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3272  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3273  __Pyx_GOTREF(__pyx_t_4);
3274  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3275  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3276  if (__pyx_t_2) {
3277 
3278  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":188
3279  * self.data_type_name = b'float32'
3280  * elif A.dtype == b'float64':
3281  * self.data_type_name = b'float64' # <<<<<<<<<<<<<<
3282  * elif A.dtype == b'float128':
3283  * self.data_type_name = b'float128'
3284  */
3285  __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3286  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float64");
3287 
3288  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":187
3289  * if A.dtype == b'float32':
3290  * self.data_type_name = b'float32'
3291  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3292  * self.data_type_name = b'float64'
3293  * elif A.dtype == b'float128':
3294  */
3295  goto __pyx_L5;
3296  }
3297 
3298  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":189
3299  * elif A.dtype == b'float64':
3300  * self.data_type_name = b'float64'
3301  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3302  * self.data_type_name = b'float128'
3303  * else:
3304  */
3305  __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error))
3306  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
3307  __Pyx_GOTREF(__pyx_t_4);
3308  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
3309  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3310  if (likely(__pyx_t_2)) {
3311 
3312  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":190
3313  * self.data_type_name = b'float64'
3314  * elif A.dtype == b'float128':
3315  * self.data_type_name = b'float128' # <<<<<<<<<<<<<<
3316  * else:
3317  * raise TypeError('Data type should be float32, float64, or ' +
3318  */
3319  __Pyx_TraceLine(190,0,__PYX_ERR(0, 190, __pyx_L1_error))
3320  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float128");
3321 
3322  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":189
3323  * elif A.dtype == b'float64':
3324  * self.data_type_name = b'float64'
3325  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3326  * self.data_type_name = b'float128'
3327  * else:
3328  */
3329  goto __pyx_L5;
3330  }
3331 
3332  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":192
3333  * self.data_type_name = b'float128'
3334  * else:
3335  * raise TypeError('Data type should be float32, float64, or ' + # <<<<<<<<<<<<<<
3336  * 'float128.')
3337  *
3338  */
3339  __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
3340  /*else*/ {
3341  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
3342  __Pyx_GOTREF(__pyx_t_4);
3343  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3344  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3345  __PYX_ERR(0, 192, __pyx_L1_error)
3346  }
3347  __pyx_L5:;
3348 
3349  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":196
3350  *
3351  * # Check if B is noe to be considered as identity matrix
3352  * if B is None: # <<<<<<<<<<<<<<
3353  *
3354  * # B is assumed to be identity
3355  */
3356  __Pyx_TraceLine(196,0,__PYX_ERR(0, 196, __pyx_L1_error))
3357  __pyx_t_2 = (__pyx_v_B == Py_None);
3358  __pyx_t_1 = (__pyx_t_2 != 0);
3359  if (__pyx_t_1) {
3360 
3361  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":199
3362  *
3363  * # B is assumed to be identity
3364  * B_is_identity = True # <<<<<<<<<<<<<<
3365  *
3366  * else:
3367  */
3368  __Pyx_TraceLine(199,0,__PYX_ERR(0, 199, __pyx_L1_error))
3369  __pyx_v_B_is_identity = 1;
3370 
3371  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":196
3372  *
3373  * # Check if B is noe to be considered as identity matrix
3374  * if B is None: # <<<<<<<<<<<<<<
3375  *
3376  * # B is assumed to be identity
3377  */
3378  goto __pyx_L6;
3379  }
3380 
3381  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":204
3382  *
3383  * # B is neither zero nor identity
3384  * B_is_identity = False # <<<<<<<<<<<<<<
3385  *
3386  * # Check similar types of A and B
3387  */
3388  __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
3389  /*else*/ {
3390  __pyx_v_B_is_identity = 0;
3391 
3392  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":207
3393  *
3394  * # Check similar types of A and B
3395  * if not (type(A) == type(B)): # <<<<<<<<<<<<<<
3396  * raise TypeError('Matrices A and B should have similar types.')
3397  *
3398  */
3399  __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
3400  __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_A)), ((PyObject *)Py_TYPE(__pyx_v_B)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
3401  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 207, __pyx_L1_error)
3402  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3403  __pyx_t_2 = ((!__pyx_t_1) != 0);
3404  if (unlikely(__pyx_t_2)) {
3405 
3406  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":208
3407  * # Check similar types of A and B
3408  * if not (type(A) == type(B)):
3409  * raise TypeError('Matrices A and B should have similar types.') # <<<<<<<<<<<<<<
3410  *
3411  * # Check A and B have the same data types
3412  */
3413  __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error))
3414  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
3415  __Pyx_GOTREF(__pyx_t_4);
3416  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3417  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3418  __PYX_ERR(0, 208, __pyx_L1_error)
3419 
3420  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":207
3421  *
3422  * # Check similar types of A and B
3423  * if not (type(A) == type(B)): # <<<<<<<<<<<<<<
3424  * raise TypeError('Matrices A and B should have similar types.')
3425  *
3426  */
3427  }
3428 
3429  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":211
3430  *
3431  * # Check A and B have the same data types
3432  * if not (A.dtype == B.dtype): # <<<<<<<<<<<<<<
3433  * raise TypeError('A and B should have similar data types.')
3434  *
3435  */
3436  __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
3437  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
3438  __Pyx_GOTREF(__pyx_t_4);
3439  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
3440  __Pyx_GOTREF(__pyx_t_3);
3441  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
3442  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3443  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3444  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
3445  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3446  __pyx_t_1 = ((!__pyx_t_2) != 0);
3447  if (unlikely(__pyx_t_1)) {
3448 
3449  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":212
3450  * # Check A and B have the same data types
3451  * if not (A.dtype == B.dtype):
3452  * raise TypeError('A and B should have similar data types.') # <<<<<<<<<<<<<<
3453  *
3454  * # Check consistent sizes of A and B
3455  */
3456  __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error))
3457  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
3458  __Pyx_GOTREF(__pyx_t_5);
3459  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3460  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3461  __PYX_ERR(0, 212, __pyx_L1_error)
3462 
3463  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":211
3464  *
3465  * # Check A and B have the same data types
3466  * if not (A.dtype == B.dtype): # <<<<<<<<<<<<<<
3467  * raise TypeError('A and B should have similar data types.')
3468  *
3469  */
3470  }
3471 
3472  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":215
3473  *
3474  * # Check consistent sizes of A and B
3475  * if not (A.shape == B.shape): # <<<<<<<<<<<<<<
3476  * raise ValueError('A and B should have the same shape.')
3477  *
3478  */
3479  __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error))
3480  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
3481  __Pyx_GOTREF(__pyx_t_5);
3482  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
3483  __Pyx_GOTREF(__pyx_t_3);
3484  __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
3485  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3486  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3487  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
3488  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3489  __pyx_t_2 = ((!__pyx_t_1) != 0);
3490  if (unlikely(__pyx_t_2)) {
3491 
3492  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":216
3493  * # Check consistent sizes of A and B
3494  * if not (A.shape == B.shape):
3495  * raise ValueError('A and B should have the same shape.') # <<<<<<<<<<<<<<
3496  *
3497  * # Determine A is sparse or dense
3498  */
3499  __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
3500  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
3501  __Pyx_GOTREF(__pyx_t_4);
3502  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3503  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3504  __PYX_ERR(0, 216, __pyx_L1_error)
3505 
3506  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":215
3507  *
3508  * # Check consistent sizes of A and B
3509  * if not (A.shape == B.shape): # <<<<<<<<<<<<<<
3510  * raise ValueError('A and B should have the same shape.')
3511  *
3512  */
3513  }
3514  }
3515  __pyx_L6:;
3516 
3517  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":219
3518  *
3519  * # Determine A is sparse or dense
3520  * if issparse(A): # <<<<<<<<<<<<<<
3521  *
3522  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3523  */
3524  __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error))
3525  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
3526  __Pyx_GOTREF(__pyx_t_3);
3527  __pyx_t_5 = NULL;
3528  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3529  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3530  if (likely(__pyx_t_5)) {
3531  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3532  __Pyx_INCREF(__pyx_t_5);
3533  __Pyx_INCREF(function);
3534  __Pyx_DECREF_SET(__pyx_t_3, function);
3535  }
3536  }
3537  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3538  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3539  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
3540  __Pyx_GOTREF(__pyx_t_4);
3541  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3542  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 219, __pyx_L1_error)
3543  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3544  if (__pyx_t_2) {
3545 
3546  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":222
3547  *
3548  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3549  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3550  *
3551  * # Check sorted indices
3552  */
3553  __Pyx_TraceLine(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
3554  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
3555  __Pyx_GOTREF(__pyx_t_3);
3556  __pyx_t_5 = NULL;
3557  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3558  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3559  if (likely(__pyx_t_5)) {
3560  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3561  __Pyx_INCREF(__pyx_t_5);
3562  __Pyx_INCREF(function);
3563  __Pyx_DECREF_SET(__pyx_t_3, function);
3564  }
3565  }
3566  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3567  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3568  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
3569  __Pyx_GOTREF(__pyx_t_4);
3570  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3571  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 222, __pyx_L1_error)
3572  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3573  if (__pyx_t_2) {
3574 
3575  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":225
3576  *
3577  * # Check sorted indices
3578  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3579  * A.sort_indices()
3580  *
3581  */
3582  __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
3583  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
3584  __Pyx_GOTREF(__pyx_t_4);
3585  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 225, __pyx_L1_error)
3586  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3587  __pyx_t_1 = ((!__pyx_t_2) != 0);
3588  if (__pyx_t_1) {
3589 
3590  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":226
3591  * # Check sorted indices
3592  * if not A.has_sorted_indices:
3593  * A.sort_indices() # <<<<<<<<<<<<<<
3594  *
3595  * if (not B_is_identity) and (not B.has_sorted_indices):
3596  */
3597  __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
3598  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error)
3599  __Pyx_GOTREF(__pyx_t_3);
3600  __pyx_t_5 = NULL;
3601  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3602  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3603  if (likely(__pyx_t_5)) {
3604  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3605  __Pyx_INCREF(__pyx_t_5);
3606  __Pyx_INCREF(function);
3607  __Pyx_DECREF_SET(__pyx_t_3, function);
3608  }
3609  }
3610  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3611  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3612  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
3613  __Pyx_GOTREF(__pyx_t_4);
3614  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3615  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3616 
3617  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":225
3618  *
3619  * # Check sorted indices
3620  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3621  * A.sort_indices()
3622  *
3623  */
3624  }
3625 
3626  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":228
3627  * A.sort_indices()
3628  *
3629  * if (not B_is_identity) and (not B.has_sorted_indices): # <<<<<<<<<<<<<<
3630  * B.sort_indices()
3631  *
3632  */
3633  __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error))
3634  __pyx_t_2 = ((!(__pyx_v_B_is_identity != 0)) != 0);
3635  if (__pyx_t_2) {
3636  } else {
3637  __pyx_t_1 = __pyx_t_2;
3638  goto __pyx_L14_bool_binop_done;
3639  }
3640  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
3641  __Pyx_GOTREF(__pyx_t_4);
3642  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 228, __pyx_L1_error)
3643  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3644  __pyx_t_6 = ((!__pyx_t_2) != 0);
3645  __pyx_t_1 = __pyx_t_6;
3646  __pyx_L14_bool_binop_done:;
3647  if (__pyx_t_1) {
3648 
3649  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":229
3650  *
3651  * if (not B_is_identity) and (not B.has_sorted_indices):
3652  * B.sort_indices() # <<<<<<<<<<<<<<
3653  *
3654  * # CSR matrix
3655  */
3656  __Pyx_TraceLine(229,0,__PYX_ERR(0, 229, __pyx_L1_error))
3657  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
3658  __Pyx_GOTREF(__pyx_t_3);
3659  __pyx_t_5 = NULL;
3660  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3661  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3662  if (likely(__pyx_t_5)) {
3663  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3664  __Pyx_INCREF(__pyx_t_5);
3665  __Pyx_INCREF(function);
3666  __Pyx_DECREF_SET(__pyx_t_3, function);
3667  }
3668  }
3669  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3670  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3671  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
3672  __Pyx_GOTREF(__pyx_t_4);
3673  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3674  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3675 
3676  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":228
3677  * A.sort_indices()
3678  *
3679  * if (not B_is_identity) and (not B.has_sorted_indices): # <<<<<<<<<<<<<<
3680  * B.sort_indices()
3681  *
3682  */
3683  }
3684 
3685  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":232
3686  *
3687  * # CSR matrix
3688  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3689  * self.set_csr_matrix_float(A, B, B_is_identity)
3690  *
3691  */
3692  __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
3693  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
3694  __Pyx_GOTREF(__pyx_t_4);
3695  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
3696  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3697  if (__pyx_t_1) {
3698 
3699  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":233
3700  * # CSR matrix
3701  * if self.data_type_name == b'float32':
3702  * self.set_csr_matrix_float(A, B, B_is_identity) # <<<<<<<<<<<<<<
3703  *
3704  * elif self.data_type_name == b'float64':
3705  */
3706  __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
3707  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
3708  __Pyx_GOTREF(__pyx_t_3);
3709  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error)
3710  __Pyx_GOTREF(__pyx_t_5);
3711  __pyx_t_7 = NULL;
3712  __pyx_t_8 = 0;
3713  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3714  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
3715  if (likely(__pyx_t_7)) {
3716  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3717  __Pyx_INCREF(__pyx_t_7);
3718  __Pyx_INCREF(function);
3719  __Pyx_DECREF_SET(__pyx_t_3, function);
3720  __pyx_t_8 = 1;
3721  }
3722  }
3723  #if CYTHON_FAST_PYCALL
3724  if (PyFunction_Check(__pyx_t_3)) {
3725  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3726  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3727  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3728  __Pyx_GOTREF(__pyx_t_4);
3729  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3730  } else
3731  #endif
3732  #if CYTHON_FAST_PYCCALL
3733  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3734  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3735  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3736  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3737  __Pyx_GOTREF(__pyx_t_4);
3738  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3739  } else
3740  #endif
3741  {
3742  __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error)
3743  __Pyx_GOTREF(__pyx_t_9);
3744  if (__pyx_t_7) {
3745  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
3746  }
3747  __Pyx_INCREF(__pyx_v_A);
3748  __Pyx_GIVEREF(__pyx_v_A);
3749  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
3750  __Pyx_INCREF(__pyx_v_B);
3751  __Pyx_GIVEREF(__pyx_v_B);
3752  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
3753  __Pyx_GIVEREF(__pyx_t_5);
3754  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
3755  __pyx_t_5 = 0;
3756  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3757  __Pyx_GOTREF(__pyx_t_4);
3758  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3759  }
3760  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3761  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3762 
3763  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":232
3764  *
3765  * # CSR matrix
3766  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3767  * self.set_csr_matrix_float(A, B, B_is_identity)
3768  *
3769  */
3770  goto __pyx_L16;
3771  }
3772 
3773  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":235
3774  * self.set_csr_matrix_float(A, B, B_is_identity)
3775  *
3776  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3777  * self.set_csr_matrix_double(A, B, B_is_identity)
3778  *
3779  */
3780  __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
3781  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
3782  __Pyx_GOTREF(__pyx_t_4);
3783  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
3784  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3785  if (__pyx_t_1) {
3786 
3787  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":236
3788  *
3789  * elif self.data_type_name == b'float64':
3790  * self.set_csr_matrix_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
3791  *
3792  * elif self.data_type_name == b'float128':
3793  */
3794  __Pyx_TraceLine(236,0,__PYX_ERR(0, 236, __pyx_L1_error))
3795  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
3796  __Pyx_GOTREF(__pyx_t_3);
3797  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L1_error)
3798  __Pyx_GOTREF(__pyx_t_9);
3799  __pyx_t_5 = NULL;
3800  __pyx_t_8 = 0;
3801  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3802  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3803  if (likely(__pyx_t_5)) {
3804  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3805  __Pyx_INCREF(__pyx_t_5);
3806  __Pyx_INCREF(function);
3807  __Pyx_DECREF_SET(__pyx_t_3, function);
3808  __pyx_t_8 = 1;
3809  }
3810  }
3811  #if CYTHON_FAST_PYCALL
3812  if (PyFunction_Check(__pyx_t_3)) {
3813  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
3814  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3815  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3816  __Pyx_GOTREF(__pyx_t_4);
3817  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3818  } else
3819  #endif
3820  #if CYTHON_FAST_PYCCALL
3821  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3822  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
3823  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3824  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3825  __Pyx_GOTREF(__pyx_t_4);
3826  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3827  } else
3828  #endif
3829  {
3830  __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error)
3831  __Pyx_GOTREF(__pyx_t_7);
3832  if (__pyx_t_5) {
3833  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
3834  }
3835  __Pyx_INCREF(__pyx_v_A);
3836  __Pyx_GIVEREF(__pyx_v_A);
3837  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
3838  __Pyx_INCREF(__pyx_v_B);
3839  __Pyx_GIVEREF(__pyx_v_B);
3840  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
3841  __Pyx_GIVEREF(__pyx_t_9);
3842  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
3843  __pyx_t_9 = 0;
3844  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3845  __Pyx_GOTREF(__pyx_t_4);
3846  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3847  }
3848  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3849  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3850 
3851  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":235
3852  * self.set_csr_matrix_float(A, B, B_is_identity)
3853  *
3854  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3855  * self.set_csr_matrix_double(A, B, B_is_identity)
3856  *
3857  */
3858  goto __pyx_L16;
3859  }
3860 
3861  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":238
3862  * self.set_csr_matrix_double(A, B, B_is_identity)
3863  *
3864  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3865  * self.set_csr_matrix_long_double(A, B, B_is_identity)
3866  *
3867  */
3868  __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error))
3869  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error)
3870  __Pyx_GOTREF(__pyx_t_4);
3871  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
3872  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3873  if (__pyx_t_1) {
3874 
3875  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":239
3876  *
3877  * elif self.data_type_name == b'float128':
3878  * self.set_csr_matrix_long_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
3879  *
3880  * elif isspmatrix_csc(A):
3881  */
3882  __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error))
3883  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
3884  __Pyx_GOTREF(__pyx_t_3);
3885  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error)
3886  __Pyx_GOTREF(__pyx_t_7);
3887  __pyx_t_9 = NULL;
3888  __pyx_t_8 = 0;
3889  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3890  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
3891  if (likely(__pyx_t_9)) {
3892  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3893  __Pyx_INCREF(__pyx_t_9);
3894  __Pyx_INCREF(function);
3895  __Pyx_DECREF_SET(__pyx_t_3, function);
3896  __pyx_t_8 = 1;
3897  }
3898  }
3899  #if CYTHON_FAST_PYCALL
3900  if (PyFunction_Check(__pyx_t_3)) {
3901  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
3902  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3903  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3904  __Pyx_GOTREF(__pyx_t_4);
3905  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3906  } else
3907  #endif
3908  #if CYTHON_FAST_PYCCALL
3909  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3910  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
3911  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3912  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3913  __Pyx_GOTREF(__pyx_t_4);
3914  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3915  } else
3916  #endif
3917  {
3918  __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error)
3919  __Pyx_GOTREF(__pyx_t_5);
3920  if (__pyx_t_9) {
3921  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
3922  }
3923  __Pyx_INCREF(__pyx_v_A);
3924  __Pyx_GIVEREF(__pyx_v_A);
3925  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
3926  __Pyx_INCREF(__pyx_v_B);
3927  __Pyx_GIVEREF(__pyx_v_B);
3928  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
3929  __Pyx_GIVEREF(__pyx_t_7);
3930  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
3931  __pyx_t_7 = 0;
3932  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3933  __Pyx_GOTREF(__pyx_t_4);
3934  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3935  }
3936  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3937  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3938 
3939  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":238
3940  * self.set_csr_matrix_double(A, B, B_is_identity)
3941  *
3942  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3943  * self.set_csr_matrix_long_double(A, B, B_is_identity)
3944  *
3945  */
3946  }
3947  __pyx_L16:;
3948 
3949  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":222
3950  *
3951  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3952  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3953  *
3954  * # Check sorted indices
3955  */
3956  goto __pyx_L11;
3957  }
3958 
3959  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":241
3960  * self.set_csr_matrix_long_double(A, B, B_is_identity)
3961  *
3962  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
3963  *
3964  * # Check sorted indices
3965  */
3966  __Pyx_TraceLine(241,0,__PYX_ERR(0, 241, __pyx_L1_error))
3967  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
3968  __Pyx_GOTREF(__pyx_t_3);
3969  __pyx_t_5 = NULL;
3970  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3971  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3972  if (likely(__pyx_t_5)) {
3973  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3974  __Pyx_INCREF(__pyx_t_5);
3975  __Pyx_INCREF(function);
3976  __Pyx_DECREF_SET(__pyx_t_3, function);
3977  }
3978  }
3979  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3980  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3981  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
3982  __Pyx_GOTREF(__pyx_t_4);
3983  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3984  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 241, __pyx_L1_error)
3985  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3986  if (__pyx_t_1) {
3987 
3988  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":244
3989  *
3990  * # Check sorted indices
3991  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3992  * A.sort_indices()
3993  *
3994  */
3995  __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error))
3996  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
3997  __Pyx_GOTREF(__pyx_t_4);
3998  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
3999  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4000  __pyx_t_6 = ((!__pyx_t_1) != 0);
4001  if (__pyx_t_6) {
4002 
4003  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":245
4004  * # Check sorted indices
4005  * if not A.has_sorted_indices:
4006  * A.sort_indices() # <<<<<<<<<<<<<<
4007  *
4008  * if (not B_is_identity) and (not B.has_sorted_indices):
4009  */
4010  __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
4011  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
4012  __Pyx_GOTREF(__pyx_t_3);
4013  __pyx_t_5 = NULL;
4014  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4015  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4016  if (likely(__pyx_t_5)) {
4017  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4018  __Pyx_INCREF(__pyx_t_5);
4019  __Pyx_INCREF(function);
4020  __Pyx_DECREF_SET(__pyx_t_3, function);
4021  }
4022  }
4023  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4024  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4025  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
4026  __Pyx_GOTREF(__pyx_t_4);
4027  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4028  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4029 
4030  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":244
4031  *
4032  * # Check sorted indices
4033  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
4034  * A.sort_indices()
4035  *
4036  */
4037  }
4038 
4039  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":247
4040  * A.sort_indices()
4041  *
4042  * if (not B_is_identity) and (not B.has_sorted_indices): # <<<<<<<<<<<<<<
4043  * B.sort_indices()
4044  *
4045  */
4046  __Pyx_TraceLine(247,0,__PYX_ERR(0, 247, __pyx_L1_error))
4047  __pyx_t_1 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4048  if (__pyx_t_1) {
4049  } else {
4050  __pyx_t_6 = __pyx_t_1;
4051  goto __pyx_L19_bool_binop_done;
4052  }
4053  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
4054  __Pyx_GOTREF(__pyx_t_4);
4055  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 247, __pyx_L1_error)
4056  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4057  __pyx_t_2 = ((!__pyx_t_1) != 0);
4058  __pyx_t_6 = __pyx_t_2;
4059  __pyx_L19_bool_binop_done:;
4060  if (__pyx_t_6) {
4061 
4062  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":248
4063  *
4064  * if (not B_is_identity) and (not B.has_sorted_indices):
4065  * B.sort_indices() # <<<<<<<<<<<<<<
4066  *
4067  * # CSC matrix
4068  */
4069  __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
4070  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
4071  __Pyx_GOTREF(__pyx_t_3);
4072  __pyx_t_5 = NULL;
4073  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4074  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4075  if (likely(__pyx_t_5)) {
4076  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4077  __Pyx_INCREF(__pyx_t_5);
4078  __Pyx_INCREF(function);
4079  __Pyx_DECREF_SET(__pyx_t_3, function);
4080  }
4081  }
4082  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4083  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4084  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
4085  __Pyx_GOTREF(__pyx_t_4);
4086  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4087  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4088 
4089  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":247
4090  * A.sort_indices()
4091  *
4092  * if (not B_is_identity) and (not B.has_sorted_indices): # <<<<<<<<<<<<<<
4093  * B.sort_indices()
4094  *
4095  */
4096  }
4097 
4098  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":251
4099  *
4100  * # CSC matrix
4101  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4102  * self.set_csc_matrix_float(A, B, B_is_identity)
4103  *
4104  */
4105  __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
4106  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
4107  __Pyx_GOTREF(__pyx_t_4);
4108  __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 251, __pyx_L1_error)
4109  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4110  if (__pyx_t_6) {
4111 
4112  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":252
4113  * # CSC matrix
4114  * if self.data_type_name == b'float32':
4115  * self.set_csc_matrix_float(A, B, B_is_identity) # <<<<<<<<<<<<<<
4116  *
4117  * elif self.data_type_name == b'float64':
4118  */
4119  __Pyx_TraceLine(252,0,__PYX_ERR(0, 252, __pyx_L1_error))
4120  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
4121  __Pyx_GOTREF(__pyx_t_3);
4122  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
4123  __Pyx_GOTREF(__pyx_t_5);
4124  __pyx_t_7 = NULL;
4125  __pyx_t_8 = 0;
4126  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4127  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4128  if (likely(__pyx_t_7)) {
4129  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4130  __Pyx_INCREF(__pyx_t_7);
4131  __Pyx_INCREF(function);
4132  __Pyx_DECREF_SET(__pyx_t_3, function);
4133  __pyx_t_8 = 1;
4134  }
4135  }
4136  #if CYTHON_FAST_PYCALL
4137  if (PyFunction_Check(__pyx_t_3)) {
4138  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4139  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
4140  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4141  __Pyx_GOTREF(__pyx_t_4);
4142  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4143  } else
4144  #endif
4145  #if CYTHON_FAST_PYCCALL
4146  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4147  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4148  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
4149  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4150  __Pyx_GOTREF(__pyx_t_4);
4151  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4152  } else
4153  #endif
4154  {
4155  __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error)
4156  __Pyx_GOTREF(__pyx_t_9);
4157  if (__pyx_t_7) {
4158  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4159  }
4160  __Pyx_INCREF(__pyx_v_A);
4161  __Pyx_GIVEREF(__pyx_v_A);
4162  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
4163  __Pyx_INCREF(__pyx_v_B);
4164  __Pyx_GIVEREF(__pyx_v_B);
4165  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
4166  __Pyx_GIVEREF(__pyx_t_5);
4167  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4168  __pyx_t_5 = 0;
4169  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
4170  __Pyx_GOTREF(__pyx_t_4);
4171  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4172  }
4173  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4174  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4175 
4176  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":251
4177  *
4178  * # CSC matrix
4179  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4180  * self.set_csc_matrix_float(A, B, B_is_identity)
4181  *
4182  */
4183  goto __pyx_L21;
4184  }
4185 
4186  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":254
4187  * self.set_csc_matrix_float(A, B, B_is_identity)
4188  *
4189  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4190  * self.set_csc_matrix_double(A, B, B_is_identity)
4191  *
4192  */
4193  __Pyx_TraceLine(254,0,__PYX_ERR(0, 254, __pyx_L1_error))
4194  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
4195  __Pyx_GOTREF(__pyx_t_4);
4196  __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 254, __pyx_L1_error)
4197  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4198  if (__pyx_t_6) {
4199 
4200  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":255
4201  *
4202  * elif self.data_type_name == b'float64':
4203  * self.set_csc_matrix_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
4204  *
4205  * elif self.data_type_name == b'float128':
4206  */
4207  __Pyx_TraceLine(255,0,__PYX_ERR(0, 255, __pyx_L1_error))
4208  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
4209  __Pyx_GOTREF(__pyx_t_3);
4210  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 255, __pyx_L1_error)
4211  __Pyx_GOTREF(__pyx_t_9);
4212  __pyx_t_5 = NULL;
4213  __pyx_t_8 = 0;
4214  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4215  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4216  if (likely(__pyx_t_5)) {
4217  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4218  __Pyx_INCREF(__pyx_t_5);
4219  __Pyx_INCREF(function);
4220  __Pyx_DECREF_SET(__pyx_t_3, function);
4221  __pyx_t_8 = 1;
4222  }
4223  }
4224  #if CYTHON_FAST_PYCALL
4225  if (PyFunction_Check(__pyx_t_3)) {
4226  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4227  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4228  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4229  __Pyx_GOTREF(__pyx_t_4);
4230  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4231  } else
4232  #endif
4233  #if CYTHON_FAST_PYCCALL
4234  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4235  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4236  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4237  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4238  __Pyx_GOTREF(__pyx_t_4);
4239  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4240  } else
4241  #endif
4242  {
4243  __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
4244  __Pyx_GOTREF(__pyx_t_7);
4245  if (__pyx_t_5) {
4246  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4247  }
4248  __Pyx_INCREF(__pyx_v_A);
4249  __Pyx_GIVEREF(__pyx_v_A);
4250  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
4251  __Pyx_INCREF(__pyx_v_B);
4252  __Pyx_GIVEREF(__pyx_v_B);
4253  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
4254  __Pyx_GIVEREF(__pyx_t_9);
4255  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4256  __pyx_t_9 = 0;
4257  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4258  __Pyx_GOTREF(__pyx_t_4);
4259  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4260  }
4261  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4262  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4263 
4264  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":254
4265  * self.set_csc_matrix_float(A, B, B_is_identity)
4266  *
4267  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4268  * self.set_csc_matrix_double(A, B, B_is_identity)
4269  *
4270  */
4271  goto __pyx_L21;
4272  }
4273 
4274  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":257
4275  * self.set_csc_matrix_double(A, B, B_is_identity)
4276  *
4277  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4278  * self.set_csc_matrix_long_double(A, B, B_is_identity)
4279  *
4280  */
4281  __Pyx_TraceLine(257,0,__PYX_ERR(0, 257, __pyx_L1_error))
4282  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
4283  __Pyx_GOTREF(__pyx_t_4);
4284  __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
4285  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4286  if (__pyx_t_6) {
4287 
4288  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":258
4289  *
4290  * elif self.data_type_name == b'float128':
4291  * self.set_csc_matrix_long_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
4292  *
4293  * else:
4294  */
4295  __Pyx_TraceLine(258,0,__PYX_ERR(0, 258, __pyx_L1_error))
4296  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
4297  __Pyx_GOTREF(__pyx_t_3);
4298  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
4299  __Pyx_GOTREF(__pyx_t_7);
4300  __pyx_t_9 = NULL;
4301  __pyx_t_8 = 0;
4302  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4303  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4304  if (likely(__pyx_t_9)) {
4305  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4306  __Pyx_INCREF(__pyx_t_9);
4307  __Pyx_INCREF(function);
4308  __Pyx_DECREF_SET(__pyx_t_3, function);
4309  __pyx_t_8 = 1;
4310  }
4311  }
4312  #if CYTHON_FAST_PYCALL
4313  if (PyFunction_Check(__pyx_t_3)) {
4314  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4315  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4316  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4317  __Pyx_GOTREF(__pyx_t_4);
4318  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4319  } else
4320  #endif
4321  #if CYTHON_FAST_PYCCALL
4322  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4323  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4324  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4325  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4326  __Pyx_GOTREF(__pyx_t_4);
4327  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4328  } else
4329  #endif
4330  {
4331  __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
4332  __Pyx_GOTREF(__pyx_t_5);
4333  if (__pyx_t_9) {
4334  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4335  }
4336  __Pyx_INCREF(__pyx_v_A);
4337  __Pyx_GIVEREF(__pyx_v_A);
4338  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
4339  __Pyx_INCREF(__pyx_v_B);
4340  __Pyx_GIVEREF(__pyx_v_B);
4341  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
4342  __Pyx_GIVEREF(__pyx_t_7);
4343  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4344  __pyx_t_7 = 0;
4345  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4346  __Pyx_GOTREF(__pyx_t_4);
4347  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4348  }
4349  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4350  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4351 
4352  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":257
4353  * self.set_csc_matrix_double(A, B, B_is_identity)
4354  *
4355  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4356  * self.set_csc_matrix_long_double(A, B, B_is_identity)
4357  *
4358  */
4359  }
4360  __pyx_L21:;
4361 
4362  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":241
4363  * self.set_csr_matrix_long_double(A, B, B_is_identity)
4364  *
4365  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
4366  *
4367  * # Check sorted indices
4368  */
4369  goto __pyx_L11;
4370  }
4371 
4372  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":263
4373  *
4374  * # If A is neither CSR or CSC, convert A to CSR
4375  * self.A_csr = csr_matrix(A) # <<<<<<<<<<<<<<
4376  *
4377  * if not B_is_identity:
4378  */
4379  __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error))
4380  /*else*/ {
4381  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
4382  __Pyx_GOTREF(__pyx_t_3);
4383  __pyx_t_5 = NULL;
4384  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4385  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4386  if (likely(__pyx_t_5)) {
4387  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4388  __Pyx_INCREF(__pyx_t_5);
4389  __Pyx_INCREF(function);
4390  __Pyx_DECREF_SET(__pyx_t_3, function);
4391  }
4392  }
4393  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4394  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4395  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
4396  __Pyx_GOTREF(__pyx_t_4);
4397  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4398  __Pyx_GIVEREF(__pyx_t_4);
4399  __Pyx_GOTREF(__pyx_v_self->A_csr);
4400  __Pyx_DECREF(__pyx_v_self->A_csr);
4401  __pyx_v_self->A_csr = __pyx_t_4;
4402  __pyx_t_4 = 0;
4403 
4404  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":265
4405  * self.A_csr = csr_matrix(A)
4406  *
4407  * if not B_is_identity: # <<<<<<<<<<<<<<
4408  * self.B_csr = csr_matrix(B)
4409  * else:
4410  */
4411  __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error))
4412  __pyx_t_6 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4413  if (__pyx_t_6) {
4414 
4415  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":266
4416  *
4417  * if not B_is_identity:
4418  * self.B_csr = csr_matrix(B) # <<<<<<<<<<<<<<
4419  * else:
4420  * self.B_csr = B
4421  */
4422  __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error))
4423  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
4424  __Pyx_GOTREF(__pyx_t_3);
4425  __pyx_t_5 = NULL;
4426  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4427  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4428  if (likely(__pyx_t_5)) {
4429  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4430  __Pyx_INCREF(__pyx_t_5);
4431  __Pyx_INCREF(function);
4432  __Pyx_DECREF_SET(__pyx_t_3, function);
4433  }
4434  }
4435  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_B) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_B);
4436  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4437  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
4438  __Pyx_GOTREF(__pyx_t_4);
4439  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4440  __Pyx_GIVEREF(__pyx_t_4);
4441  __Pyx_GOTREF(__pyx_v_self->B_csr);
4442  __Pyx_DECREF(__pyx_v_self->B_csr);
4443  __pyx_v_self->B_csr = __pyx_t_4;
4444  __pyx_t_4 = 0;
4445 
4446  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":265
4447  * self.A_csr = csr_matrix(A)
4448  *
4449  * if not B_is_identity: # <<<<<<<<<<<<<<
4450  * self.B_csr = csr_matrix(B)
4451  * else:
4452  */
4453  goto __pyx_L22;
4454  }
4455 
4456  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":268
4457  * self.B_csr = csr_matrix(B)
4458  * else:
4459  * self.B_csr = B # <<<<<<<<<<<<<<
4460  *
4461  * # Check sorted indices
4462  */
4463  __Pyx_TraceLine(268,0,__PYX_ERR(0, 268, __pyx_L1_error))
4464  /*else*/ {
4465  __Pyx_INCREF(__pyx_v_B);
4466  __Pyx_GIVEREF(__pyx_v_B);
4467  __Pyx_GOTREF(__pyx_v_self->B_csr);
4468  __Pyx_DECREF(__pyx_v_self->B_csr);
4469  __pyx_v_self->B_csr = __pyx_v_B;
4470  }
4471  __pyx_L22:;
4472 
4473  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":271
4474  *
4475  * # Check sorted indices
4476  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
4477  * self.A_csr.sort_indices()
4478  *
4479  */
4480  __Pyx_TraceLine(271,0,__PYX_ERR(0, 271, __pyx_L1_error))
4481  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
4482  __Pyx_GOTREF(__pyx_t_4);
4483  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
4484  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4485  __pyx_t_2 = ((!__pyx_t_6) != 0);
4486  if (__pyx_t_2) {
4487 
4488  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":272
4489  * # Check sorted indices
4490  * if not self.A_csr.has_sorted_indices:
4491  * self.A_csr.sort_indices() # <<<<<<<<<<<<<<
4492  *
4493  * if (not B_is_identity) and (not self.B_csr.has_sorted_indices):
4494  */
4495  __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
4496  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
4497  __Pyx_GOTREF(__pyx_t_3);
4498  __pyx_t_5 = NULL;
4499  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4500  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4501  if (likely(__pyx_t_5)) {
4502  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4503  __Pyx_INCREF(__pyx_t_5);
4504  __Pyx_INCREF(function);
4505  __Pyx_DECREF_SET(__pyx_t_3, function);
4506  }
4507  }
4508  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4509  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4510  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
4511  __Pyx_GOTREF(__pyx_t_4);
4512  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4513  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4514 
4515  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":271
4516  *
4517  * # Check sorted indices
4518  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
4519  * self.A_csr.sort_indices()
4520  *
4521  */
4522  }
4523 
4524  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":274
4525  * self.A_csr.sort_indices()
4526  *
4527  * if (not B_is_identity) and (not self.B_csr.has_sorted_indices): # <<<<<<<<<<<<<<
4528  * self.B_csr.sort_indices()
4529  *
4530  */
4531  __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error))
4532  __pyx_t_6 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4533  if (__pyx_t_6) {
4534  } else {
4535  __pyx_t_2 = __pyx_t_6;
4536  goto __pyx_L25_bool_binop_done;
4537  }
4538  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->B_csr, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
4539  __Pyx_GOTREF(__pyx_t_4);
4540  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 274, __pyx_L1_error)
4541  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4542  __pyx_t_1 = ((!__pyx_t_6) != 0);
4543  __pyx_t_2 = __pyx_t_1;
4544  __pyx_L25_bool_binop_done:;
4545  if (__pyx_t_2) {
4546 
4547  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":275
4548  *
4549  * if (not B_is_identity) and (not self.B_csr.has_sorted_indices):
4550  * self.B_csr.sort_indices() # <<<<<<<<<<<<<<
4551  *
4552  * # CSR matrix
4553  */
4554  __Pyx_TraceLine(275,0,__PYX_ERR(0, 275, __pyx_L1_error))
4555  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->B_csr, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
4556  __Pyx_GOTREF(__pyx_t_3);
4557  __pyx_t_5 = NULL;
4558  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4559  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4560  if (likely(__pyx_t_5)) {
4561  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4562  __Pyx_INCREF(__pyx_t_5);
4563  __Pyx_INCREF(function);
4564  __Pyx_DECREF_SET(__pyx_t_3, function);
4565  }
4566  }
4567  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4568  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4569  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
4570  __Pyx_GOTREF(__pyx_t_4);
4571  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4572  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4573 
4574  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":274
4575  * self.A_csr.sort_indices()
4576  *
4577  * if (not B_is_identity) and (not self.B_csr.has_sorted_indices): # <<<<<<<<<<<<<<
4578  * self.B_csr.sort_indices()
4579  *
4580  */
4581  }
4582 
4583  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":278
4584  *
4585  * # CSR matrix
4586  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4587  * self.set_csr_matrix_float(self.A_csr, self.B_csr,
4588  * B_is_identity)
4589  */
4590  __Pyx_TraceLine(278,0,__PYX_ERR(0, 278, __pyx_L1_error))
4591  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
4592  __Pyx_GOTREF(__pyx_t_4);
4593  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
4594  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4595  if (__pyx_t_2) {
4596 
4597  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":279
4598  * # CSR matrix
4599  * if self.data_type_name == b'float32':
4600  * self.set_csr_matrix_float(self.A_csr, self.B_csr, # <<<<<<<<<<<<<<
4601  * B_is_identity)
4602  *
4603  */
4604  __Pyx_TraceLine(279,0,__PYX_ERR(0, 279, __pyx_L1_error))
4605  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4606  __Pyx_GOTREF(__pyx_t_3);
4607 
4608  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":280
4609  * if self.data_type_name == b'float32':
4610  * self.set_csr_matrix_float(self.A_csr, self.B_csr,
4611  * B_is_identity) # <<<<<<<<<<<<<<
4612  *
4613  * elif self.data_type_name == b'float64':
4614  */
4615  __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error))
4616  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
4617  __Pyx_GOTREF(__pyx_t_5);
4618  __pyx_t_7 = NULL;
4619  __pyx_t_8 = 0;
4620  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4621  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4622  if (likely(__pyx_t_7)) {
4623  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4624  __Pyx_INCREF(__pyx_t_7);
4625  __Pyx_INCREF(function);
4626  __Pyx_DECREF_SET(__pyx_t_3, function);
4627  __pyx_t_8 = 1;
4628  }
4629  }
4630  #if CYTHON_FAST_PYCALL
4631  if (PyFunction_Check(__pyx_t_3)) {
4632  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_5};
4633  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4634  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4635  __Pyx_GOTREF(__pyx_t_4);
4636  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4637  } else
4638  #endif
4639  #if CYTHON_FAST_PYCCALL
4640  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4641  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_5};
4642  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4643  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4644  __Pyx_GOTREF(__pyx_t_4);
4645  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4646  } else
4647  #endif
4648  {
4649  __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error)
4650  __Pyx_GOTREF(__pyx_t_9);
4651  if (__pyx_t_7) {
4652  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4653  }
4654  __Pyx_INCREF(__pyx_v_self->A_csr);
4655  __Pyx_GIVEREF(__pyx_v_self->A_csr);
4656  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_self->A_csr);
4657  __Pyx_INCREF(__pyx_v_self->B_csr);
4658  __Pyx_GIVEREF(__pyx_v_self->B_csr);
4659  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_self->B_csr);
4660  __Pyx_GIVEREF(__pyx_t_5);
4661  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4662  __pyx_t_5 = 0;
4663  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4664  __Pyx_GOTREF(__pyx_t_4);
4665  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4666  }
4667  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4668  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4669 
4670  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":278
4671  *
4672  * # CSR matrix
4673  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4674  * self.set_csr_matrix_float(self.A_csr, self.B_csr,
4675  * B_is_identity)
4676  */
4677  goto __pyx_L27;
4678  }
4679 
4680  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":282
4681  * B_is_identity)
4682  *
4683  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4684  * self.set_csr_matrix_double(self.A_csr, self.B_csr,
4685  * B_is_identity)
4686  */
4687  __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4688  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
4689  __Pyx_GOTREF(__pyx_t_4);
4690  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 282, __pyx_L1_error)
4691  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4692  if (__pyx_t_2) {
4693 
4694  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":283
4695  *
4696  * elif self.data_type_name == b'float64':
4697  * self.set_csr_matrix_double(self.A_csr, self.B_csr, # <<<<<<<<<<<<<<
4698  * B_is_identity)
4699  *
4700  */
4701  __Pyx_TraceLine(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
4702  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
4703  __Pyx_GOTREF(__pyx_t_3);
4704 
4705  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":284
4706  * elif self.data_type_name == b'float64':
4707  * self.set_csr_matrix_double(self.A_csr, self.B_csr,
4708  * B_is_identity) # <<<<<<<<<<<<<<
4709  *
4710  * elif self.data_type_name == b'float128':
4711  */
4712  __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error))
4713  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L1_error)
4714  __Pyx_GOTREF(__pyx_t_9);
4715  __pyx_t_5 = NULL;
4716  __pyx_t_8 = 0;
4717  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4718  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4719  if (likely(__pyx_t_5)) {
4720  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4721  __Pyx_INCREF(__pyx_t_5);
4722  __Pyx_INCREF(function);
4723  __Pyx_DECREF_SET(__pyx_t_3, function);
4724  __pyx_t_8 = 1;
4725  }
4726  }
4727  #if CYTHON_FAST_PYCALL
4728  if (PyFunction_Check(__pyx_t_3)) {
4729  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_9};
4730  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4731  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4732  __Pyx_GOTREF(__pyx_t_4);
4733  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4734  } else
4735  #endif
4736  #if CYTHON_FAST_PYCCALL
4737  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4738  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_9};
4739  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4740  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4741  __Pyx_GOTREF(__pyx_t_4);
4742  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4743  } else
4744  #endif
4745  {
4746  __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
4747  __Pyx_GOTREF(__pyx_t_7);
4748  if (__pyx_t_5) {
4749  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4750  }
4751  __Pyx_INCREF(__pyx_v_self->A_csr);
4752  __Pyx_GIVEREF(__pyx_v_self->A_csr);
4753  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_self->A_csr);
4754  __Pyx_INCREF(__pyx_v_self->B_csr);
4755  __Pyx_GIVEREF(__pyx_v_self->B_csr);
4756  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_self->B_csr);
4757  __Pyx_GIVEREF(__pyx_t_9);
4758  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4759  __pyx_t_9 = 0;
4760  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4761  __Pyx_GOTREF(__pyx_t_4);
4762  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4763  }
4764  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4765  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4766 
4767  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":282
4768  * B_is_identity)
4769  *
4770  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4771  * self.set_csr_matrix_double(self.A_csr, self.B_csr,
4772  * B_is_identity)
4773  */
4774  goto __pyx_L27;
4775  }
4776 
4777  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":286
4778  * B_is_identity)
4779  *
4780  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4781  * self.set_csr_matrix_long_double(self.A_csr, self.B_csr,
4782  * B_is_identity)
4783  */
4784  __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4785  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
4786  __Pyx_GOTREF(__pyx_t_4);
4787  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4788  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4789  if (__pyx_t_2) {
4790 
4791  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":287
4792  *
4793  * elif self.data_type_name == b'float128':
4794  * self.set_csr_matrix_long_double(self.A_csr, self.B_csr, # <<<<<<<<<<<<<<
4795  * B_is_identity)
4796  *
4797  */
4798  __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4799  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
4800  __Pyx_GOTREF(__pyx_t_3);
4801 
4802  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":288
4803  * elif self.data_type_name == b'float128':
4804  * self.set_csr_matrix_long_double(self.A_csr, self.B_csr,
4805  * B_is_identity) # <<<<<<<<<<<<<<
4806  *
4807  * else:
4808  */
4809  __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4810  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error)
4811  __Pyx_GOTREF(__pyx_t_7);
4812  __pyx_t_9 = NULL;
4813  __pyx_t_8 = 0;
4814  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4815  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4816  if (likely(__pyx_t_9)) {
4817  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4818  __Pyx_INCREF(__pyx_t_9);
4819  __Pyx_INCREF(function);
4820  __Pyx_DECREF_SET(__pyx_t_3, function);
4821  __pyx_t_8 = 1;
4822  }
4823  }
4824  #if CYTHON_FAST_PYCALL
4825  if (PyFunction_Check(__pyx_t_3)) {
4826  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_7};
4827  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4828  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4829  __Pyx_GOTREF(__pyx_t_4);
4830  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4831  } else
4832  #endif
4833  #if CYTHON_FAST_PYCCALL
4834  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4835  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_7};
4836  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4837  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4838  __Pyx_GOTREF(__pyx_t_4);
4839  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4840  } else
4841  #endif
4842  {
4843  __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
4844  __Pyx_GOTREF(__pyx_t_5);
4845  if (__pyx_t_9) {
4846  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4847  }
4848  __Pyx_INCREF(__pyx_v_self->A_csr);
4849  __Pyx_GIVEREF(__pyx_v_self->A_csr);
4850  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_self->A_csr);
4851  __Pyx_INCREF(__pyx_v_self->B_csr);
4852  __Pyx_GIVEREF(__pyx_v_self->B_csr);
4853  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_self->B_csr);
4854  __Pyx_GIVEREF(__pyx_t_7);
4855  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4856  __pyx_t_7 = 0;
4857  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4858  __Pyx_GOTREF(__pyx_t_4);
4859  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4860  }
4861  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4862  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4863 
4864  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":286
4865  * B_is_identity)
4866  *
4867  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4868  * self.set_csr_matrix_long_double(self.A_csr, self.B_csr,
4869  * B_is_identity)
4870  */
4871  }
4872  __pyx_L27:;
4873  }
4874  __pyx_L11:;
4875 
4876  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":219
4877  *
4878  * # Determine A is sparse or dense
4879  * if issparse(A): # <<<<<<<<<<<<<<
4880  *
4881  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
4882  */
4883  goto __pyx_L10;
4884  }
4885 
4886  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":293
4887  *
4888  * # Set a dense matrix
4889  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4890  * self.set_dense_matrix_float(A, B, B_is_identity)
4891  *
4892  */
4893  __Pyx_TraceLine(293,0,__PYX_ERR(0, 293, __pyx_L1_error))
4894  /*else*/ {
4895  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
4896  __Pyx_GOTREF(__pyx_t_4);
4897  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 293, __pyx_L1_error)
4898  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4899  if (__pyx_t_2) {
4900 
4901  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":294
4902  * # Set a dense matrix
4903  * if self.data_type_name == b'float32':
4904  * self.set_dense_matrix_float(A, B, B_is_identity) # <<<<<<<<<<<<<<
4905  *
4906  * elif self.data_type_name == b'float64':
4907  */
4908  __Pyx_TraceLine(294,0,__PYX_ERR(0, 294, __pyx_L1_error))
4909  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
4910  __Pyx_GOTREF(__pyx_t_3);
4911  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error)
4912  __Pyx_GOTREF(__pyx_t_5);
4913  __pyx_t_7 = NULL;
4914  __pyx_t_8 = 0;
4915  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4916  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4917  if (likely(__pyx_t_7)) {
4918  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4919  __Pyx_INCREF(__pyx_t_7);
4920  __Pyx_INCREF(function);
4921  __Pyx_DECREF_SET(__pyx_t_3, function);
4922  __pyx_t_8 = 1;
4923  }
4924  }
4925  #if CYTHON_FAST_PYCALL
4926  if (PyFunction_Check(__pyx_t_3)) {
4927  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4928  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4929  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4930  __Pyx_GOTREF(__pyx_t_4);
4931  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4932  } else
4933  #endif
4934  #if CYTHON_FAST_PYCCALL
4935  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4936  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4937  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4938  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4939  __Pyx_GOTREF(__pyx_t_4);
4940  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4941  } else
4942  #endif
4943  {
4944  __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L1_error)
4945  __Pyx_GOTREF(__pyx_t_9);
4946  if (__pyx_t_7) {
4947  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4948  }
4949  __Pyx_INCREF(__pyx_v_A);
4950  __Pyx_GIVEREF(__pyx_v_A);
4951  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
4952  __Pyx_INCREF(__pyx_v_B);
4953  __Pyx_GIVEREF(__pyx_v_B);
4954  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
4955  __Pyx_GIVEREF(__pyx_t_5);
4956  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4957  __pyx_t_5 = 0;
4958  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4959  __Pyx_GOTREF(__pyx_t_4);
4960  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4961  }
4962  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4963  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4964 
4965  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":293
4966  *
4967  * # Set a dense matrix
4968  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4969  * self.set_dense_matrix_float(A, B, B_is_identity)
4970  *
4971  */
4972  goto __pyx_L28;
4973  }
4974 
4975  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":296
4976  * self.set_dense_matrix_float(A, B, B_is_identity)
4977  *
4978  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4979  * self.set_dense_matrix_double(A, B, B_is_identity)
4980  *
4981  */
4982  __Pyx_TraceLine(296,0,__PYX_ERR(0, 296, __pyx_L1_error))
4983  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
4984  __Pyx_GOTREF(__pyx_t_4);
4985  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
4986  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4987  if (__pyx_t_2) {
4988 
4989  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":297
4990  *
4991  * elif self.data_type_name == b'float64':
4992  * self.set_dense_matrix_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
4993  *
4994  * elif self.data_type_name == b'float128':
4995  */
4996  __Pyx_TraceLine(297,0,__PYX_ERR(0, 297, __pyx_L1_error))
4997  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
4998  __Pyx_GOTREF(__pyx_t_3);
4999  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 297, __pyx_L1_error)
5000  __Pyx_GOTREF(__pyx_t_9);
5001  __pyx_t_5 = NULL;
5002  __pyx_t_8 = 0;
5003  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5004  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
5005  if (likely(__pyx_t_5)) {
5006  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5007  __Pyx_INCREF(__pyx_t_5);
5008  __Pyx_INCREF(function);
5009  __Pyx_DECREF_SET(__pyx_t_3, function);
5010  __pyx_t_8 = 1;
5011  }
5012  }
5013  #if CYTHON_FAST_PYCALL
5014  if (PyFunction_Check(__pyx_t_3)) {
5015  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
5016  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
5017  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5018  __Pyx_GOTREF(__pyx_t_4);
5019  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5020  } else
5021  #endif
5022  #if CYTHON_FAST_PYCCALL
5023  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5024  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
5025  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
5026  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5027  __Pyx_GOTREF(__pyx_t_4);
5028  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5029  } else
5030  #endif
5031  {
5032  __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
5033  __Pyx_GOTREF(__pyx_t_7);
5034  if (__pyx_t_5) {
5035  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
5036  }
5037  __Pyx_INCREF(__pyx_v_A);
5038  __Pyx_GIVEREF(__pyx_v_A);
5039  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
5040  __Pyx_INCREF(__pyx_v_B);
5041  __Pyx_GIVEREF(__pyx_v_B);
5042  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
5043  __Pyx_GIVEREF(__pyx_t_9);
5044  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
5045  __pyx_t_9 = 0;
5046  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
5047  __Pyx_GOTREF(__pyx_t_4);
5048  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5049  }
5050  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5051  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5052 
5053  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":296
5054  * self.set_dense_matrix_float(A, B, B_is_identity)
5055  *
5056  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
5057  * self.set_dense_matrix_double(A, B, B_is_identity)
5058  *
5059  */
5060  goto __pyx_L28;
5061  }
5062 
5063  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":299
5064  * self.set_dense_matrix_double(A, B, B_is_identity)
5065  *
5066  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
5067  * self.set_dense_matrix_long_double(A, B, B_is_identity)
5068  *
5069  */
5070  __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error))
5071  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
5072  __Pyx_GOTREF(__pyx_t_4);
5073  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
5074  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5075  if (__pyx_t_2) {
5076 
5077  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":300
5078  *
5079  * elif self.data_type_name == b'float128':
5080  * self.set_dense_matrix_long_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
5081  *
5082  * # ======================
5083  */
5084  __Pyx_TraceLine(300,0,__PYX_ERR(0, 300, __pyx_L1_error))
5085  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
5086  __Pyx_GOTREF(__pyx_t_3);
5087  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
5088  __Pyx_GOTREF(__pyx_t_7);
5089  __pyx_t_9 = NULL;
5090  __pyx_t_8 = 0;
5091  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5092  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
5093  if (likely(__pyx_t_9)) {
5094  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5095  __Pyx_INCREF(__pyx_t_9);
5096  __Pyx_INCREF(function);
5097  __Pyx_DECREF_SET(__pyx_t_3, function);
5098  __pyx_t_8 = 1;
5099  }
5100  }
5101  #if CYTHON_FAST_PYCALL
5102  if (PyFunction_Check(__pyx_t_3)) {
5103  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
5104  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
5105  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5106  __Pyx_GOTREF(__pyx_t_4);
5107  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5108  } else
5109  #endif
5110  #if CYTHON_FAST_PYCCALL
5111  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5112  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
5113  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
5114  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5115  __Pyx_GOTREF(__pyx_t_4);
5116  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5117  } else
5118  #endif
5119  {
5120  __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
5121  __Pyx_GOTREF(__pyx_t_5);
5122  if (__pyx_t_9) {
5123  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
5124  }
5125  __Pyx_INCREF(__pyx_v_A);
5126  __Pyx_GIVEREF(__pyx_v_A);
5127  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
5128  __Pyx_INCREF(__pyx_v_B);
5129  __Pyx_GIVEREF(__pyx_v_B);
5130  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
5131  __Pyx_GIVEREF(__pyx_t_7);
5132  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
5133  __pyx_t_7 = 0;
5134  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
5135  __Pyx_GOTREF(__pyx_t_4);
5136  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5137  }
5138  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5139  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5140 
5141  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":299
5142  * self.set_dense_matrix_double(A, B, B_is_identity)
5143  *
5144  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
5145  * self.set_dense_matrix_long_double(A, B, B_is_identity)
5146  *
5147  */
5148  }
5149  __pyx_L28:;
5150  }
5151  __pyx_L10:;
5152 
5153  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":172
5154  * # =========
5155  *
5156  * def __cinit__(self, A, B=None): # <<<<<<<<<<<<<<
5157  * """
5158  * Sets matrices A and B.
5159  */
5160 
5161  /* function exit code */
5162  __pyx_r = 0;
5163  goto __pyx_L0;
5164  __pyx_L1_error:;
5165  __Pyx_XDECREF(__pyx_t_3);
5166  __Pyx_XDECREF(__pyx_t_4);
5167  __Pyx_XDECREF(__pyx_t_5);
5168  __Pyx_XDECREF(__pyx_t_7);
5169  __Pyx_XDECREF(__pyx_t_9);
5170  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5171  __pyx_r = -1;
5172  __pyx_L0:;
5173  __Pyx_TraceReturn(Py_None, 0);
5174  __Pyx_RefNannyFinishContext();
5175  return __pyx_r;
5176 }
5177 
5178 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":306
5179  * # ======================
5180  *
5181  * def set_dense_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
5182  * """
5183  * Sets matrix A.
5184  */
5185 
5186 /* Python wrapper */
5187 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5188 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float[] = "pycAffineMatrixFunction.set_dense_matrix_float(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
5189 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float = {"set_dense_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float};
5190 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5191  PyObject *__pyx_v_A = 0;
5192  PyObject *__pyx_v_B = 0;
5193  PyObject *__pyx_v_B_is_identity = 0;
5194  int __pyx_lineno = 0;
5195  const char *__pyx_filename = NULL;
5196  int __pyx_clineno = 0;
5197  PyObject *__pyx_r = 0;
5198  __Pyx_RefNannyDeclarations
5199  __Pyx_RefNannySetupContext("set_dense_matrix_float (wrapper)", 0);
5200  {
5201  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
5202  PyObject* values[3] = {0,0,0};
5203  if (unlikely(__pyx_kwds)) {
5204  Py_ssize_t kw_args;
5205  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5206  switch (pos_args) {
5207  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5208  CYTHON_FALLTHROUGH;
5209  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5210  CYTHON_FALLTHROUGH;
5211  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5212  CYTHON_FALLTHROUGH;
5213  case 0: break;
5214  default: goto __pyx_L5_argtuple_error;
5215  }
5216  kw_args = PyDict_Size(__pyx_kwds);
5217  switch (pos_args) {
5218  case 0:
5219  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5220  else goto __pyx_L5_argtuple_error;
5221  CYTHON_FALLTHROUGH;
5222  case 1:
5223  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5224  else {
5225  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 306, __pyx_L3_error)
5226  }
5227  CYTHON_FALLTHROUGH;
5228  case 2:
5229  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
5230  else {
5231  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 306, __pyx_L3_error)
5232  }
5233  }
5234  if (unlikely(kw_args > 0)) {
5235  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_dense_matrix_float") < 0)) __PYX_ERR(0, 306, __pyx_L3_error)
5236  }
5237  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5238  goto __pyx_L5_argtuple_error;
5239  } else {
5240  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5241  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5242  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5243  }
5244  __pyx_v_A = values[0];
5245  __pyx_v_B = values[1];
5246  __pyx_v_B_is_identity = values[2];
5247  }
5248  goto __pyx_L4_argument_unpacking_done;
5249  __pyx_L5_argtuple_error:;
5250  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 306, __pyx_L3_error)
5251  __pyx_L3_error:;
5252  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5253  __Pyx_RefNannyFinishContext();
5254  return NULL;
5255  __pyx_L4_argument_unpacking_done:;
5256  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
5257 
5258  /* function exit code */
5259  __Pyx_RefNannyFinishContext();
5260  return __pyx_r;
5261 }
5262 
5263 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
5264  LongIndexType __pyx_v_A_num_rows;
5265  LongIndexType __pyx_v_A_num_columns;
5266  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
5267  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
5268  __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5269  __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5270  __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5271  __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5272  float *__pyx_v_A_data;
5273  float *__pyx_v_B_data;
5274  PyObject *__pyx_r = NULL;
5275  __Pyx_TraceDeclarations
5276  __Pyx_RefNannyDeclarations
5277  PyObject *__pyx_t_1 = NULL;
5278  PyObject *__pyx_t_2 = NULL;
5279  LongIndexType __pyx_t_3;
5280  int __pyx_t_4;
5281  int __pyx_t_5;
5282  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5283  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5284  Py_ssize_t __pyx_t_8;
5285  Py_ssize_t __pyx_t_9;
5287  int __pyx_lineno = 0;
5288  const char *__pyx_filename = NULL;
5289  int __pyx_clineno = 0;
5290  __Pyx_TraceFrameInit(__pyx_codeobj__7)
5291  __Pyx_RefNannySetupContext("set_dense_matrix_float", 0);
5292  __Pyx_TraceCall("set_dense_matrix_float", __pyx_f[0], 306, 0, __PYX_ERR(0, 306, __pyx_L1_error));
5293 
5294  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":315
5295  *
5296  * # Matrix size
5297  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5298  * cdef LongIndexType A_num_columns = A.shape[1]
5299  *
5300  */
5301  __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
5302  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
5303  __Pyx_GOTREF(__pyx_t_1);
5304  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
5305  __Pyx_GOTREF(__pyx_t_2);
5306  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5307  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error)
5308  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5309  __pyx_v_A_num_rows = __pyx_t_3;
5310 
5311  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":316
5312  * # Matrix size
5313  * cdef LongIndexType A_num_rows = A.shape[0]
5314  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5315  *
5316  * # Contiguity
5317  */
5318  __Pyx_TraceLine(316,0,__PYX_ERR(0, 316, __pyx_L1_error))
5319  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
5320  __Pyx_GOTREF(__pyx_t_2);
5321  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
5322  __Pyx_GOTREF(__pyx_t_1);
5323  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5324  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error)
5325  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5326  __pyx_v_A_num_columns = __pyx_t_3;
5327 
5328  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":320
5329  * # Contiguity
5330  * cdef FlagType A_is_row_major
5331  * cdef FlagType B_is_row_major = 0 # <<<<<<<<<<<<<<
5332  *
5333  * if A.flags['C_CONTIGUOUS']:
5334  */
5335  __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error))
5336  __pyx_v_B_is_row_major = 0;
5337 
5338  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":322
5339  * cdef FlagType B_is_row_major = 0
5340  *
5341  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5342  * A_is_row_major = 1
5343  * elif A.flags['F_CONTIGUOUS']:
5344  */
5345  __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error))
5346  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
5347  __Pyx_GOTREF(__pyx_t_1);
5348  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
5349  __Pyx_GOTREF(__pyx_t_2);
5350  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5351  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 322, __pyx_L1_error)
5352  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5353  if (__pyx_t_4) {
5354 
5355  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":323
5356  *
5357  * if A.flags['C_CONTIGUOUS']:
5358  * A_is_row_major = 1 # <<<<<<<<<<<<<<
5359  * elif A.flags['F_CONTIGUOUS']:
5360  * A_is_row_major = 0
5361  */
5362  __Pyx_TraceLine(323,0,__PYX_ERR(0, 323, __pyx_L1_error))
5363  __pyx_v_A_is_row_major = 1;
5364 
5365  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":322
5366  * cdef FlagType B_is_row_major = 0
5367  *
5368  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5369  * A_is_row_major = 1
5370  * elif A.flags['F_CONTIGUOUS']:
5371  */
5372  goto __pyx_L3;
5373  }
5374 
5375  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":324
5376  * if A.flags['C_CONTIGUOUS']:
5377  * A_is_row_major = 1
5378  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5379  * A_is_row_major = 0
5380  * else:
5381  */
5382  __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error))
5383  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
5384  __Pyx_GOTREF(__pyx_t_2);
5385  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
5386  __Pyx_GOTREF(__pyx_t_1);
5387  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5388  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
5389  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5390  if (likely(__pyx_t_4)) {
5391 
5392  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":325
5393  * A_is_row_major = 1
5394  * elif A.flags['F_CONTIGUOUS']:
5395  * A_is_row_major = 0 # <<<<<<<<<<<<<<
5396  * else:
5397  * raise TypeError('Matrix A should be either C or F contiguous.')
5398  */
5399  __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error))
5400  __pyx_v_A_is_row_major = 0;
5401 
5402  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":324
5403  * if A.flags['C_CONTIGUOUS']:
5404  * A_is_row_major = 1
5405  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5406  * A_is_row_major = 0
5407  * else:
5408  */
5409  goto __pyx_L3;
5410  }
5411 
5412  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":327
5413  * A_is_row_major = 0
5414  * else:
5415  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
5416  *
5417  * if not B_is_identity:
5418  */
5419  __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error))
5420  /*else*/ {
5421  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
5422  __Pyx_GOTREF(__pyx_t_1);
5423  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5424  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5425  __PYX_ERR(0, 327, __pyx_L1_error)
5426  }
5427  __pyx_L3:;
5428 
5429  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":329
5430  * raise TypeError('Matrix A should be either C or F contiguous.')
5431  *
5432  * if not B_is_identity: # <<<<<<<<<<<<<<
5433  * if B.flags['C_CONTIGUOUS']:
5434  * B_is_row_major = 1
5435  */
5436  __Pyx_TraceLine(329,0,__PYX_ERR(0, 329, __pyx_L1_error))
5437  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 329, __pyx_L1_error)
5438  __pyx_t_5 = ((!__pyx_t_4) != 0);
5439  if (__pyx_t_5) {
5440 
5441  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":330
5442  *
5443  * if not B_is_identity:
5444  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5445  * B_is_row_major = 1
5446  * elif B.flags['F_CONTIGUOUS']:
5447  */
5448  __Pyx_TraceLine(330,0,__PYX_ERR(0, 330, __pyx_L1_error))
5449  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
5450  __Pyx_GOTREF(__pyx_t_1);
5451  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
5452  __Pyx_GOTREF(__pyx_t_2);
5453  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5454  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 330, __pyx_L1_error)
5455  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5456  if (__pyx_t_5) {
5457 
5458  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":331
5459  * if not B_is_identity:
5460  * if B.flags['C_CONTIGUOUS']:
5461  * B_is_row_major = 1 # <<<<<<<<<<<<<<
5462  * elif B.flags['F_CONTIGUOUS']:
5463  * B_is_row_major = 0
5464  */
5465  __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error))
5466  __pyx_v_B_is_row_major = 1;
5467 
5468  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":330
5469  *
5470  * if not B_is_identity:
5471  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5472  * B_is_row_major = 1
5473  * elif B.flags['F_CONTIGUOUS']:
5474  */
5475  goto __pyx_L5;
5476  }
5477 
5478  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":332
5479  * if B.flags['C_CONTIGUOUS']:
5480  * B_is_row_major = 1
5481  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5482  * B_is_row_major = 0
5483  * else:
5484  */
5485  __Pyx_TraceLine(332,0,__PYX_ERR(0, 332, __pyx_L1_error))
5486  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
5487  __Pyx_GOTREF(__pyx_t_2);
5488  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
5489  __Pyx_GOTREF(__pyx_t_1);
5490  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5491  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
5492  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5493  if (likely(__pyx_t_5)) {
5494 
5495  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":333
5496  * B_is_row_major = 1
5497  * elif B.flags['F_CONTIGUOUS']:
5498  * B_is_row_major = 0 # <<<<<<<<<<<<<<
5499  * else:
5500  * raise TypeError('Matrix B should be either C or F contiguous.')
5501  */
5502  __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error))
5503  __pyx_v_B_is_row_major = 0;
5504 
5505  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":332
5506  * if B.flags['C_CONTIGUOUS']:
5507  * B_is_row_major = 1
5508  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5509  * B_is_row_major = 0
5510  * else:
5511  */
5512  goto __pyx_L5;
5513  }
5514 
5515  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":335
5516  * B_is_row_major = 0
5517  * else:
5518  * raise TypeError('Matrix B should be either C or F contiguous.') # <<<<<<<<<<<<<<
5519  *
5520  * # Declare memoryviews to get data pointer
5521  */
5522  __Pyx_TraceLine(335,0,__PYX_ERR(0, 335, __pyx_L1_error))
5523  /*else*/ {
5524  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
5525  __Pyx_GOTREF(__pyx_t_1);
5526  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5527  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5528  __PYX_ERR(0, 335, __pyx_L1_error)
5529  }
5530  __pyx_L5:;
5531 
5532  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":329
5533  * raise TypeError('Matrix A should be either C or F contiguous.')
5534  *
5535  * if not B_is_identity: # <<<<<<<<<<<<<<
5536  * if B.flags['C_CONTIGUOUS']:
5537  * B_is_row_major = 1
5538  */
5539  }
5540 
5541  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":340
5542  * cdef float[:, ::1] A_data_mv_c
5543  * cdef float[::1, :] A_data_mv_f
5544  * cdef float[:, ::1] B_data_mv_c = None # <<<<<<<<<<<<<<
5545  * cdef float[::1, :] B_data_mv_f = None
5546  *
5547  */
5548  __Pyx_TraceLine(340,0,__PYX_ERR(0, 340, __pyx_L1_error))
5549  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 340, __pyx_L1_error)
5550  __pyx_v_B_data_mv_c = __pyx_t_6;
5551  __pyx_t_6.memview = NULL;
5552  __pyx_t_6.data = NULL;
5553 
5554  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":341
5555  * cdef float[::1, :] A_data_mv_f
5556  * cdef float[:, ::1] B_data_mv_c = None
5557  * cdef float[::1, :] B_data_mv_f = None # <<<<<<<<<<<<<<
5558  *
5559  * # Declare pointer of A.data and B.data
5560  */
5561  __Pyx_TraceLine(341,0,__PYX_ERR(0, 341, __pyx_L1_error))
5562  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 341, __pyx_L1_error)
5563  __pyx_v_B_data_mv_f = __pyx_t_7;
5564  __pyx_t_7.memview = NULL;
5565  __pyx_t_7.data = NULL;
5566 
5567  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":345
5568  * # Declare pointer of A.data and B.data
5569  * cdef float* A_data
5570  * cdef float* B_data = NULL # <<<<<<<<<<<<<<
5571  *
5572  * # Get pointer to data of A depending on row or column major
5573  */
5574  __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
5575  __pyx_v_B_data = NULL;
5576 
5577  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":348
5578  *
5579  * # Get pointer to data of A depending on row or column major
5580  * if A_is_row_major: # <<<<<<<<<<<<<<
5581  *
5582  * # Memoryview of A for row major matrix
5583  */
5584  __Pyx_TraceLine(348,0,__PYX_ERR(0, 348, __pyx_L1_error))
5585  __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
5586  if (__pyx_t_5) {
5587 
5588  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":351
5589  *
5590  * # Memoryview of A for row major matrix
5591  * A_data_mv_c = A # <<<<<<<<<<<<<<
5592  *
5593  * # Pointer of the data of A
5594  */
5595  __Pyx_TraceLine(351,0,__PYX_ERR(0, 351, __pyx_L1_error))
5596  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 351, __pyx_L1_error)
5597  __pyx_v_A_data_mv_c = __pyx_t_6;
5598  __pyx_t_6.memview = NULL;
5599  __pyx_t_6.data = NULL;
5600 
5601  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":354
5602  *
5603  * # Pointer of the data of A
5604  * A_data = &A_data_mv_c[0, 0] # <<<<<<<<<<<<<<
5605  *
5606  * else:
5607  */
5608  __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error))
5609  __pyx_t_8 = 0;
5610  __pyx_t_9 = 0;
5611  __pyx_v_A_data = (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
5612 
5613  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":348
5614  *
5615  * # Get pointer to data of A depending on row or column major
5616  * if A_is_row_major: # <<<<<<<<<<<<<<
5617  *
5618  * # Memoryview of A for row major matrix
5619  */
5620  goto __pyx_L6;
5621  }
5622 
5623  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":359
5624  *
5625  * # Memoryview of A for column major matrix
5626  * A_data_mv_f = A # <<<<<<<<<<<<<<
5627  *
5628  * # Pointer of the data of A
5629  */
5630  __Pyx_TraceLine(359,0,__PYX_ERR(0, 359, __pyx_L1_error))
5631  /*else*/ {
5632  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 359, __pyx_L1_error)
5633  __pyx_v_A_data_mv_f = __pyx_t_7;
5634  __pyx_t_7.memview = NULL;
5635  __pyx_t_7.data = NULL;
5636 
5637  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":362
5638  *
5639  * # Pointer of the data of A
5640  * A_data = &A_data_mv_f[0, 0] # <<<<<<<<<<<<<<
5641  *
5642  * # Get pointer to data of B depending on row or column major
5643  */
5644  __Pyx_TraceLine(362,0,__PYX_ERR(0, 362, __pyx_L1_error))
5645  __pyx_t_9 = 0;
5646  __pyx_t_8 = 0;
5647  __pyx_v_A_data = (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
5648  }
5649  __pyx_L6:;
5650 
5651  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":365
5652  *
5653  * # Get pointer to data of B depending on row or column major
5654  * if not B_is_identity: # <<<<<<<<<<<<<<
5655  * if B_is_row_major:
5656  *
5657  */
5658  __Pyx_TraceLine(365,0,__PYX_ERR(0, 365, __pyx_L1_error))
5659  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
5660  __pyx_t_4 = ((!__pyx_t_5) != 0);
5661  if (__pyx_t_4) {
5662 
5663  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":366
5664  * # Get pointer to data of B depending on row or column major
5665  * if not B_is_identity:
5666  * if B_is_row_major: # <<<<<<<<<<<<<<
5667  *
5668  * # Memoryview of B for row major matrix
5669  */
5670  __Pyx_TraceLine(366,0,__PYX_ERR(0, 366, __pyx_L1_error))
5671  __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
5672  if (__pyx_t_4) {
5673 
5674  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":369
5675  *
5676  * # Memoryview of B for row major matrix
5677  * B_data_mv_c = B # <<<<<<<<<<<<<<
5678  *
5679  * # Pointer of the data of B
5680  */
5681  __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error))
5682  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 369, __pyx_L1_error)
5683  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
5684  __pyx_v_B_data_mv_c = __pyx_t_6;
5685  __pyx_t_6.memview = NULL;
5686  __pyx_t_6.data = NULL;
5687 
5688  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":372
5689  *
5690  * # Pointer of the data of B
5691  * B_data = &B_data_mv_c[0, 0] # <<<<<<<<<<<<<<
5692  *
5693  * else:
5694  */
5695  __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error))
5696  __pyx_t_8 = 0;
5697  __pyx_t_9 = 0;
5698  __pyx_v_B_data = (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
5699 
5700  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":366
5701  * # Get pointer to data of B depending on row or column major
5702  * if not B_is_identity:
5703  * if B_is_row_major: # <<<<<<<<<<<<<<
5704  *
5705  * # Memoryview of B for row major matrix
5706  */
5707  goto __pyx_L8;
5708  }
5709 
5710  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":377
5711  *
5712  * # Memoryview of B for column major matrix
5713  * B_data_mv_f = B # <<<<<<<<<<<<<<
5714  *
5715  * # Pointer of the data of B
5716  */
5717  __Pyx_TraceLine(377,0,__PYX_ERR(0, 377, __pyx_L1_error))
5718  /*else*/ {
5719  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 377, __pyx_L1_error)
5720  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
5721  __pyx_v_B_data_mv_f = __pyx_t_7;
5722  __pyx_t_7.memview = NULL;
5723  __pyx_t_7.data = NULL;
5724 
5725  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":380
5726  *
5727  * # Pointer of the data of B
5728  * B_data = &B_data_mv_f[0, 0] # <<<<<<<<<<<<<<
5729  *
5730  * # Create a linear operator object
5731  */
5732  __Pyx_TraceLine(380,0,__PYX_ERR(0, 380, __pyx_L1_error))
5733  __pyx_t_9 = 0;
5734  __pyx_t_8 = 0;
5735  __pyx_v_B_data = (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
5736  }
5737  __pyx_L8:;
5738 
5739  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":365
5740  *
5741  * # Get pointer to data of B depending on row or column major
5742  * if not B_is_identity: # <<<<<<<<<<<<<<
5743  * if B_is_row_major:
5744  *
5745  */
5746  }
5747 
5748  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":383
5749  *
5750  * # Create a linear operator object
5751  * if B_is_identity: # <<<<<<<<<<<<<<
5752  * self.Aop_float = new cDenseAffineMatrixFunction[float](
5753  * A_data,
5754  */
5755  __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error))
5756  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
5757  if (__pyx_t_4) {
5758 
5759  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":384
5760  * # Create a linear operator object
5761  * if B_is_identity:
5762  * self.Aop_float = new cDenseAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
5763  * A_data,
5764  * A_is_row_major,
5765  */
5766  __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
5767  try {
5768  __pyx_t_10 = new cDenseAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5769  } catch(...) {
5770  __Pyx_CppExn2PyErr();
5771  __PYX_ERR(0, 384, __pyx_L1_error)
5772  }
5773  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_10;
5774 
5775  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":383
5776  *
5777  * # Create a linear operator object
5778  * if B_is_identity: # <<<<<<<<<<<<<<
5779  * self.Aop_float = new cDenseAffineMatrixFunction[float](
5780  * A_data,
5781  */
5782  goto __pyx_L9;
5783  }
5784 
5785  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":390
5786  * A_num_columns)
5787  * else:
5788  * self.Aop_float = new cDenseAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
5789  * A_data,
5790  * A_is_row_major,
5791  */
5792  __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5793  /*else*/ {
5794 
5795  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":396
5796  * A_num_columns,
5797  * B_data,
5798  * B_is_row_major) # <<<<<<<<<<<<<<
5799  *
5800  * # =======================
5801  */
5802  __Pyx_TraceLine(396,0,__PYX_ERR(0, 396, __pyx_L1_error))
5803  try {
5804  __pyx_t_10 = new cDenseAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
5805  } catch(...) {
5806  __Pyx_CppExn2PyErr();
5807  __PYX_ERR(0, 390, __pyx_L1_error)
5808  }
5809 
5810  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":390
5811  * A_num_columns)
5812  * else:
5813  * self.Aop_float = new cDenseAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
5814  * A_data,
5815  * A_is_row_major,
5816  */
5817  __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5818  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_10;
5819  }
5820  __pyx_L9:;
5821 
5822  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":306
5823  * # ======================
5824  *
5825  * def set_dense_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
5826  * """
5827  * Sets matrix A.
5828  */
5829 
5830  /* function exit code */
5831  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5832  goto __pyx_L0;
5833  __pyx_L1_error:;
5834  __Pyx_XDECREF(__pyx_t_1);
5835  __Pyx_XDECREF(__pyx_t_2);
5836  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5837  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
5838  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5839  __pyx_r = NULL;
5840  __pyx_L0:;
5841  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
5842  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
5843  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
5844  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
5845  __Pyx_XGIVEREF(__pyx_r);
5846  __Pyx_TraceReturn(__pyx_r, 0);
5847  __Pyx_RefNannyFinishContext();
5848  return __pyx_r;
5849 }
5850 
5851 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":402
5852  * # =======================
5853  *
5854  * def set_dense_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
5855  * """
5856  * Sets matrix A.
5857  */
5858 
5859 /* Python wrapper */
5860 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5861 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double[] = "pycAffineMatrixFunction.set_dense_matrix_double(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
5862 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double = {"set_dense_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double};
5863 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5864  PyObject *__pyx_v_A = 0;
5865  PyObject *__pyx_v_B = 0;
5866  PyObject *__pyx_v_B_is_identity = 0;
5867  int __pyx_lineno = 0;
5868  const char *__pyx_filename = NULL;
5869  int __pyx_clineno = 0;
5870  PyObject *__pyx_r = 0;
5871  __Pyx_RefNannyDeclarations
5872  __Pyx_RefNannySetupContext("set_dense_matrix_double (wrapper)", 0);
5873  {
5874  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
5875  PyObject* values[3] = {0,0,0};
5876  if (unlikely(__pyx_kwds)) {
5877  Py_ssize_t kw_args;
5878  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5879  switch (pos_args) {
5880  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5881  CYTHON_FALLTHROUGH;
5882  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5883  CYTHON_FALLTHROUGH;
5884  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5885  CYTHON_FALLTHROUGH;
5886  case 0: break;
5887  default: goto __pyx_L5_argtuple_error;
5888  }
5889  kw_args = PyDict_Size(__pyx_kwds);
5890  switch (pos_args) {
5891  case 0:
5892  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5893  else goto __pyx_L5_argtuple_error;
5894  CYTHON_FALLTHROUGH;
5895  case 1:
5896  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5897  else {
5898  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 402, __pyx_L3_error)
5899  }
5900  CYTHON_FALLTHROUGH;
5901  case 2:
5902  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
5903  else {
5904  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 402, __pyx_L3_error)
5905  }
5906  }
5907  if (unlikely(kw_args > 0)) {
5908  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_dense_matrix_double") < 0)) __PYX_ERR(0, 402, __pyx_L3_error)
5909  }
5910  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5911  goto __pyx_L5_argtuple_error;
5912  } else {
5913  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5914  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5915  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5916  }
5917  __pyx_v_A = values[0];
5918  __pyx_v_B = values[1];
5919  __pyx_v_B_is_identity = values[2];
5920  }
5921  goto __pyx_L4_argument_unpacking_done;
5922  __pyx_L5_argtuple_error:;
5923  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 402, __pyx_L3_error)
5924  __pyx_L3_error:;
5925  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5926  __Pyx_RefNannyFinishContext();
5927  return NULL;
5928  __pyx_L4_argument_unpacking_done:;
5929  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
5930 
5931  /* function exit code */
5932  __Pyx_RefNannyFinishContext();
5933  return __pyx_r;
5934 }
5935 
5936 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
5937  LongIndexType __pyx_v_A_num_rows;
5938  LongIndexType __pyx_v_A_num_columns;
5939  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
5940  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
5941  __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5942  __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5943  __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5944  __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5945  double *__pyx_v_A_data;
5946  double *__pyx_v_B_data;
5947  PyObject *__pyx_r = NULL;
5948  __Pyx_TraceDeclarations
5949  __Pyx_RefNannyDeclarations
5950  PyObject *__pyx_t_1 = NULL;
5951  PyObject *__pyx_t_2 = NULL;
5952  LongIndexType __pyx_t_3;
5953  int __pyx_t_4;
5954  int __pyx_t_5;
5955  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5956  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5957  Py_ssize_t __pyx_t_8;
5958  Py_ssize_t __pyx_t_9;
5960  int __pyx_lineno = 0;
5961  const char *__pyx_filename = NULL;
5962  int __pyx_clineno = 0;
5963  __Pyx_TraceFrameInit(__pyx_codeobj__10)
5964  __Pyx_RefNannySetupContext("set_dense_matrix_double", 0);
5965  __Pyx_TraceCall("set_dense_matrix_double", __pyx_f[0], 402, 0, __PYX_ERR(0, 402, __pyx_L1_error));
5966 
5967  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":411
5968  *
5969  * # Matrix size
5970  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5971  * cdef LongIndexType A_num_columns = A.shape[1]
5972  *
5973  */
5974  __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5975  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
5976  __Pyx_GOTREF(__pyx_t_1);
5977  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
5978  __Pyx_GOTREF(__pyx_t_2);
5979  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5980  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
5981  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5982  __pyx_v_A_num_rows = __pyx_t_3;
5983 
5984  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":412
5985  * # Matrix size
5986  * cdef LongIndexType A_num_rows = A.shape[0]
5987  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5988  *
5989  * # Contiguity
5990  */
5991  __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error))
5992  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
5993  __Pyx_GOTREF(__pyx_t_2);
5994  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
5995  __Pyx_GOTREF(__pyx_t_1);
5996  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5997  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
5998  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5999  __pyx_v_A_num_columns = __pyx_t_3;
6000 
6001  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":416
6002  * # Contiguity
6003  * cdef FlagType A_is_row_major
6004  * cdef FlagType B_is_row_major = 0 # <<<<<<<<<<<<<<
6005  *
6006  * if A.flags['C_CONTIGUOUS']:
6007  */
6008  __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error))
6009  __pyx_v_B_is_row_major = 0;
6010 
6011  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":418
6012  * cdef FlagType B_is_row_major = 0
6013  *
6014  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6015  * A_is_row_major = 1
6016  * elif A.flags['F_CONTIGUOUS']:
6017  */
6018  __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error))
6019  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
6020  __Pyx_GOTREF(__pyx_t_1);
6021  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
6022  __Pyx_GOTREF(__pyx_t_2);
6023  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6024  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
6025  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6026  if (__pyx_t_4) {
6027 
6028  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":419
6029  *
6030  * if A.flags['C_CONTIGUOUS']:
6031  * A_is_row_major = 1 # <<<<<<<<<<<<<<
6032  * elif A.flags['F_CONTIGUOUS']:
6033  * A_is_row_major = 0
6034  */
6035  __Pyx_TraceLine(419,0,__PYX_ERR(0, 419, __pyx_L1_error))
6036  __pyx_v_A_is_row_major = 1;
6037 
6038  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":418
6039  * cdef FlagType B_is_row_major = 0
6040  *
6041  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6042  * A_is_row_major = 1
6043  * elif A.flags['F_CONTIGUOUS']:
6044  */
6045  goto __pyx_L3;
6046  }
6047 
6048  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":420
6049  * if A.flags['C_CONTIGUOUS']:
6050  * A_is_row_major = 1
6051  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6052  * A_is_row_major = 0
6053  * else:
6054  */
6055  __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
6056  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
6057  __Pyx_GOTREF(__pyx_t_2);
6058  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
6059  __Pyx_GOTREF(__pyx_t_1);
6060  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6061  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
6062  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6063  if (likely(__pyx_t_4)) {
6064 
6065  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":421
6066  * A_is_row_major = 1
6067  * elif A.flags['F_CONTIGUOUS']:
6068  * A_is_row_major = 0 # <<<<<<<<<<<<<<
6069  * else:
6070  * raise TypeError('Matrix A should be either C or F contiguous.')
6071  */
6072  __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error))
6073  __pyx_v_A_is_row_major = 0;
6074 
6075  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":420
6076  * if A.flags['C_CONTIGUOUS']:
6077  * A_is_row_major = 1
6078  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6079  * A_is_row_major = 0
6080  * else:
6081  */
6082  goto __pyx_L3;
6083  }
6084 
6085  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":423
6086  * A_is_row_major = 0
6087  * else:
6088  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
6089  *
6090  * if not B_is_identity:
6091  */
6092  __Pyx_TraceLine(423,0,__PYX_ERR(0, 423, __pyx_L1_error))
6093  /*else*/ {
6094  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
6095  __Pyx_GOTREF(__pyx_t_1);
6096  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6097  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6098  __PYX_ERR(0, 423, __pyx_L1_error)
6099  }
6100  __pyx_L3:;
6101 
6102  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":425
6103  * raise TypeError('Matrix A should be either C or F contiguous.')
6104  *
6105  * if not B_is_identity: # <<<<<<<<<<<<<<
6106  * if B.flags['C_CONTIGUOUS']:
6107  * B_is_row_major = 1
6108  */
6109  __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error))
6110  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
6111  __pyx_t_5 = ((!__pyx_t_4) != 0);
6112  if (__pyx_t_5) {
6113 
6114  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":426
6115  *
6116  * if not B_is_identity:
6117  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6118  * B_is_row_major = 1
6119  * elif B.flags['F_CONTIGUOUS']:
6120  */
6121  __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error))
6122  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
6123  __Pyx_GOTREF(__pyx_t_1);
6124  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
6125  __Pyx_GOTREF(__pyx_t_2);
6126  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6127  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
6128  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6129  if (__pyx_t_5) {
6130 
6131  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":427
6132  * if not B_is_identity:
6133  * if B.flags['C_CONTIGUOUS']:
6134  * B_is_row_major = 1 # <<<<<<<<<<<<<<
6135  * elif B.flags['F_CONTIGUOUS']:
6136  * B_is_row_major = 0
6137  */
6138  __Pyx_TraceLine(427,0,__PYX_ERR(0, 427, __pyx_L1_error))
6139  __pyx_v_B_is_row_major = 1;
6140 
6141  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":426
6142  *
6143  * if not B_is_identity:
6144  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6145  * B_is_row_major = 1
6146  * elif B.flags['F_CONTIGUOUS']:
6147  */
6148  goto __pyx_L5;
6149  }
6150 
6151  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":428
6152  * if B.flags['C_CONTIGUOUS']:
6153  * B_is_row_major = 1
6154  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6155  * B_is_row_major = 0
6156  * else:
6157  */
6158  __Pyx_TraceLine(428,0,__PYX_ERR(0, 428, __pyx_L1_error))
6159  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
6160  __Pyx_GOTREF(__pyx_t_2);
6161  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
6162  __Pyx_GOTREF(__pyx_t_1);
6163  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6164  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
6165  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6166  if (likely(__pyx_t_5)) {
6167 
6168  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":429
6169  * B_is_row_major = 1
6170  * elif B.flags['F_CONTIGUOUS']:
6171  * B_is_row_major = 0 # <<<<<<<<<<<<<<
6172  * else:
6173  * raise TypeError('Matrix B should be either C or F contiguous.')
6174  */
6175  __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error))
6176  __pyx_v_B_is_row_major = 0;
6177 
6178  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":428
6179  * if B.flags['C_CONTIGUOUS']:
6180  * B_is_row_major = 1
6181  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6182  * B_is_row_major = 0
6183  * else:
6184  */
6185  goto __pyx_L5;
6186  }
6187 
6188  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":431
6189  * B_is_row_major = 0
6190  * else:
6191  * raise TypeError('Matrix B should be either C or F contiguous.') # <<<<<<<<<<<<<<
6192  *
6193  * # Declare memoryviews to get data pointer
6194  */
6195  __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
6196  /*else*/ {
6197  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
6198  __Pyx_GOTREF(__pyx_t_1);
6199  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6200  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6201  __PYX_ERR(0, 431, __pyx_L1_error)
6202  }
6203  __pyx_L5:;
6204 
6205  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":425
6206  * raise TypeError('Matrix A should be either C or F contiguous.')
6207  *
6208  * if not B_is_identity: # <<<<<<<<<<<<<<
6209  * if B.flags['C_CONTIGUOUS']:
6210  * B_is_row_major = 1
6211  */
6212  }
6213 
6214  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":436
6215  * cdef double[:, ::1] A_data_mv_c
6216  * cdef double[::1, :] A_data_mv_f
6217  * cdef double[:, ::1] B_data_mv_c = None # <<<<<<<<<<<<<<
6218  * cdef double[::1, :] B_data_mv_f = None
6219  *
6220  */
6221  __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
6222  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 436, __pyx_L1_error)
6223  __pyx_v_B_data_mv_c = __pyx_t_6;
6224  __pyx_t_6.memview = NULL;
6225  __pyx_t_6.data = NULL;
6226 
6227  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":437
6228  * cdef double[::1, :] A_data_mv_f
6229  * cdef double[:, ::1] B_data_mv_c = None
6230  * cdef double[::1, :] B_data_mv_f = None # <<<<<<<<<<<<<<
6231  *
6232  * # Declare pointer to A.data and B.data
6233  */
6234  __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
6235  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 437, __pyx_L1_error)
6236  __pyx_v_B_data_mv_f = __pyx_t_7;
6237  __pyx_t_7.memview = NULL;
6238  __pyx_t_7.data = NULL;
6239 
6240  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":441
6241  * # Declare pointer to A.data and B.data
6242  * cdef double* A_data
6243  * cdef double* B_data = NULL # <<<<<<<<<<<<<<
6244  *
6245  * # Get pointer to data of A depending on row or column major
6246  */
6247  __Pyx_TraceLine(441,0,__PYX_ERR(0, 441, __pyx_L1_error))
6248  __pyx_v_B_data = NULL;
6249 
6250  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":444
6251  *
6252  * # Get pointer to data of A depending on row or column major
6253  * if A_is_row_major: # <<<<<<<<<<<<<<
6254  *
6255  * # Memoryview of A for row major matrix
6256  */
6257  __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error))
6258  __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
6259  if (__pyx_t_5) {
6260 
6261  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":447
6262  *
6263  * # Memoryview of A for row major matrix
6264  * A_data_mv_c = A # <<<<<<<<<<<<<<
6265  *
6266  * # Pointer of the data of A
6267  */
6268  __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
6269  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 447, __pyx_L1_error)
6270  __pyx_v_A_data_mv_c = __pyx_t_6;
6271  __pyx_t_6.memview = NULL;
6272  __pyx_t_6.data = NULL;
6273 
6274  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":450
6275  *
6276  * # Pointer of the data of A
6277  * A_data = &A_data_mv_c[0, 0] # <<<<<<<<<<<<<<
6278  *
6279  * else:
6280  */
6281  __Pyx_TraceLine(450,0,__PYX_ERR(0, 450, __pyx_L1_error))
6282  __pyx_t_8 = 0;
6283  __pyx_t_9 = 0;
6284  __pyx_v_A_data = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6285 
6286  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":444
6287  *
6288  * # Get pointer to data of A depending on row or column major
6289  * if A_is_row_major: # <<<<<<<<<<<<<<
6290  *
6291  * # Memoryview of A for row major matrix
6292  */
6293  goto __pyx_L6;
6294  }
6295 
6296  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":455
6297  *
6298  * # Memoryview of A for column major matrix
6299  * A_data_mv_f = A # <<<<<<<<<<<<<<
6300  *
6301  * # Pointer of the data of A
6302  */
6303  __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error))
6304  /*else*/ {
6305  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 455, __pyx_L1_error)
6306  __pyx_v_A_data_mv_f = __pyx_t_7;
6307  __pyx_t_7.memview = NULL;
6308  __pyx_t_7.data = NULL;
6309 
6310  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":458
6311  *
6312  * # Pointer of the data of A
6313  * A_data = &A_data_mv_f[0, 0] # <<<<<<<<<<<<<<
6314  *
6315  * # Get pointer to data of B depending on row or column major
6316  */
6317  __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
6318  __pyx_t_9 = 0;
6319  __pyx_t_8 = 0;
6320  __pyx_v_A_data = (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
6321  }
6322  __pyx_L6:;
6323 
6324  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":461
6325  *
6326  * # Get pointer to data of B depending on row or column major
6327  * if not B_is_identity: # <<<<<<<<<<<<<<
6328  * if B_is_row_major:
6329  *
6330  */
6331  __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
6332  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
6333  __pyx_t_4 = ((!__pyx_t_5) != 0);
6334  if (__pyx_t_4) {
6335 
6336  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":462
6337  * # Get pointer to data of B depending on row or column major
6338  * if not B_is_identity:
6339  * if B_is_row_major: # <<<<<<<<<<<<<<
6340  *
6341  * # Memoryview of B for row major matrix
6342  */
6343  __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error))
6344  __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
6345  if (__pyx_t_4) {
6346 
6347  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":465
6348  *
6349  * # Memoryview of B for row major matrix
6350  * B_data_mv_c = B # <<<<<<<<<<<<<<
6351  *
6352  * # Pointer of the data of B
6353  */
6354  __Pyx_TraceLine(465,0,__PYX_ERR(0, 465, __pyx_L1_error))
6355  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 465, __pyx_L1_error)
6356  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6357  __pyx_v_B_data_mv_c = __pyx_t_6;
6358  __pyx_t_6.memview = NULL;
6359  __pyx_t_6.data = NULL;
6360 
6361  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":468
6362  *
6363  * # Pointer of the data of B
6364  * B_data = &B_data_mv_c[0, 0] # <<<<<<<<<<<<<<
6365  *
6366  * else:
6367  */
6368  __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error))
6369  __pyx_t_8 = 0;
6370  __pyx_t_9 = 0;
6371  __pyx_v_B_data = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6372 
6373  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":462
6374  * # Get pointer to data of B depending on row or column major
6375  * if not B_is_identity:
6376  * if B_is_row_major: # <<<<<<<<<<<<<<
6377  *
6378  * # Memoryview of B for row major matrix
6379  */
6380  goto __pyx_L8;
6381  }
6382 
6383  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":473
6384  *
6385  * # Memoryview of B for column major matrix
6386  * B_data_mv_f = B # <<<<<<<<<<<<<<
6387  *
6388  * # Pointer of the data of B
6389  */
6390  __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error))
6391  /*else*/ {
6392  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 473, __pyx_L1_error)
6393  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6394  __pyx_v_B_data_mv_f = __pyx_t_7;
6395  __pyx_t_7.memview = NULL;
6396  __pyx_t_7.data = NULL;
6397 
6398  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":476
6399  *
6400  * # Pointer of the data of B
6401  * B_data = &B_data_mv_f[0, 0] # <<<<<<<<<<<<<<
6402  *
6403  * # Create a linear operator object
6404  */
6405  __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error))
6406  __pyx_t_9 = 0;
6407  __pyx_t_8 = 0;
6408  __pyx_v_B_data = (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
6409  }
6410  __pyx_L8:;
6411 
6412  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":461
6413  *
6414  * # Get pointer to data of B depending on row or column major
6415  * if not B_is_identity: # <<<<<<<<<<<<<<
6416  * if B_is_row_major:
6417  *
6418  */
6419  }
6420 
6421  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":479
6422  *
6423  * # Create a linear operator object
6424  * if B_is_identity: # <<<<<<<<<<<<<<
6425  * self.Aop_double = new cDenseAffineMatrixFunction[double](
6426  * A_data,
6427  */
6428  __Pyx_TraceLine(479,0,__PYX_ERR(0, 479, __pyx_L1_error))
6429  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 479, __pyx_L1_error)
6430  if (__pyx_t_4) {
6431 
6432  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":480
6433  * # Create a linear operator object
6434  * if B_is_identity:
6435  * self.Aop_double = new cDenseAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
6436  * A_data,
6437  * A_is_row_major,
6438  */
6439  __Pyx_TraceLine(480,0,__PYX_ERR(0, 480, __pyx_L1_error))
6440  try {
6441  __pyx_t_10 = new cDenseAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6442  } catch(...) {
6443  __Pyx_CppExn2PyErr();
6444  __PYX_ERR(0, 480, __pyx_L1_error)
6445  }
6446  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_10;
6447 
6448  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":479
6449  *
6450  * # Create a linear operator object
6451  * if B_is_identity: # <<<<<<<<<<<<<<
6452  * self.Aop_double = new cDenseAffineMatrixFunction[double](
6453  * A_data,
6454  */
6455  goto __pyx_L9;
6456  }
6457 
6458  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":486
6459  * A_num_columns)
6460  * else:
6461  * self.Aop_double = new cDenseAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
6462  * A_data,
6463  * A_is_row_major,
6464  */
6465  __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error))
6466  /*else*/ {
6467 
6468  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":492
6469  * A_num_columns,
6470  * B_data,
6471  * B_is_row_major) # <<<<<<<<<<<<<<
6472  *
6473  * # ============================
6474  */
6475  __Pyx_TraceLine(492,0,__PYX_ERR(0, 492, __pyx_L1_error))
6476  try {
6477  __pyx_t_10 = new cDenseAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
6478  } catch(...) {
6479  __Pyx_CppExn2PyErr();
6480  __PYX_ERR(0, 486, __pyx_L1_error)
6481  }
6482 
6483  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":486
6484  * A_num_columns)
6485  * else:
6486  * self.Aop_double = new cDenseAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
6487  * A_data,
6488  * A_is_row_major,
6489  */
6490  __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error))
6491  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_10;
6492  }
6493  __pyx_L9:;
6494 
6495  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":402
6496  * # =======================
6497  *
6498  * def set_dense_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
6499  * """
6500  * Sets matrix A.
6501  */
6502 
6503  /* function exit code */
6504  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6505  goto __pyx_L0;
6506  __pyx_L1_error:;
6507  __Pyx_XDECREF(__pyx_t_1);
6508  __Pyx_XDECREF(__pyx_t_2);
6509  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6510  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
6511  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6512  __pyx_r = NULL;
6513  __pyx_L0:;
6514  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
6515  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
6516  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6517  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6518  __Pyx_XGIVEREF(__pyx_r);
6519  __Pyx_TraceReturn(__pyx_r, 0);
6520  __Pyx_RefNannyFinishContext();
6521  return __pyx_r;
6522 }
6523 
6524 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":498
6525  * # ============================
6526  *
6527  * def set_dense_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
6528  * """
6529  * Sets matrix A.
6530  */
6531 
6532 /* Python wrapper */
6533 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6534 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double[] = "pycAffineMatrixFunction.set_dense_matrix_long_double(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
6535 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double = {"set_dense_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double};
6536 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6537  PyObject *__pyx_v_A = 0;
6538  PyObject *__pyx_v_B = 0;
6539  PyObject *__pyx_v_B_is_identity = 0;
6540  int __pyx_lineno = 0;
6541  const char *__pyx_filename = NULL;
6542  int __pyx_clineno = 0;
6543  PyObject *__pyx_r = 0;
6544  __Pyx_RefNannyDeclarations
6545  __Pyx_RefNannySetupContext("set_dense_matrix_long_double (wrapper)", 0);
6546  {
6547  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
6548  PyObject* values[3] = {0,0,0};
6549  if (unlikely(__pyx_kwds)) {
6550  Py_ssize_t kw_args;
6551  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6552  switch (pos_args) {
6553  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6554  CYTHON_FALLTHROUGH;
6555  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6556  CYTHON_FALLTHROUGH;
6557  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6558  CYTHON_FALLTHROUGH;
6559  case 0: break;
6560  default: goto __pyx_L5_argtuple_error;
6561  }
6562  kw_args = PyDict_Size(__pyx_kwds);
6563  switch (pos_args) {
6564  case 0:
6565  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6566  else goto __pyx_L5_argtuple_error;
6567  CYTHON_FALLTHROUGH;
6568  case 1:
6569  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
6570  else {
6571  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 498, __pyx_L3_error)
6572  }
6573  CYTHON_FALLTHROUGH;
6574  case 2:
6575  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
6576  else {
6577  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 498, __pyx_L3_error)
6578  }
6579  }
6580  if (unlikely(kw_args > 0)) {
6581  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_dense_matrix_long_double") < 0)) __PYX_ERR(0, 498, __pyx_L3_error)
6582  }
6583  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6584  goto __pyx_L5_argtuple_error;
6585  } else {
6586  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6587  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6588  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6589  }
6590  __pyx_v_A = values[0];
6591  __pyx_v_B = values[1];
6592  __pyx_v_B_is_identity = values[2];
6593  }
6594  goto __pyx_L4_argument_unpacking_done;
6595  __pyx_L5_argtuple_error:;
6596  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 498, __pyx_L3_error)
6597  __pyx_L3_error:;
6598  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6599  __Pyx_RefNannyFinishContext();
6600  return NULL;
6601  __pyx_L4_argument_unpacking_done:;
6602  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
6603 
6604  /* function exit code */
6605  __Pyx_RefNannyFinishContext();
6606  return __pyx_r;
6607 }
6608 
6609 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
6610  LongIndexType __pyx_v_A_num_rows;
6611  LongIndexType __pyx_v_A_num_columns;
6612  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
6613  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
6614  __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
6615  __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
6616  __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
6617  __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
6618  long double *__pyx_v_A_data;
6619  long double *__pyx_v_B_data;
6620  PyObject *__pyx_r = NULL;
6621  __Pyx_TraceDeclarations
6622  __Pyx_RefNannyDeclarations
6623  PyObject *__pyx_t_1 = NULL;
6624  PyObject *__pyx_t_2 = NULL;
6625  LongIndexType __pyx_t_3;
6626  int __pyx_t_4;
6627  int __pyx_t_5;
6628  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6629  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
6630  Py_ssize_t __pyx_t_8;
6631  Py_ssize_t __pyx_t_9;
6633  int __pyx_lineno = 0;
6634  const char *__pyx_filename = NULL;
6635  int __pyx_clineno = 0;
6636  __Pyx_TraceFrameInit(__pyx_codeobj__11)
6637  __Pyx_RefNannySetupContext("set_dense_matrix_long_double", 0);
6638  __Pyx_TraceCall("set_dense_matrix_long_double", __pyx_f[0], 498, 0, __PYX_ERR(0, 498, __pyx_L1_error));
6639 
6640  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":507
6641  *
6642  * # Matrix size
6643  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6644  * cdef LongIndexType A_num_columns = A.shape[1]
6645  *
6646  */
6647  __Pyx_TraceLine(507,0,__PYX_ERR(0, 507, __pyx_L1_error))
6648  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
6649  __Pyx_GOTREF(__pyx_t_1);
6650  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
6651  __Pyx_GOTREF(__pyx_t_2);
6652  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6653  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error)
6654  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6655  __pyx_v_A_num_rows = __pyx_t_3;
6656 
6657  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":508
6658  * # Matrix size
6659  * cdef LongIndexType A_num_rows = A.shape[0]
6660  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6661  *
6662  * # Contiguity
6663  */
6664  __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
6665  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
6666  __Pyx_GOTREF(__pyx_t_2);
6667  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
6668  __Pyx_GOTREF(__pyx_t_1);
6669  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6670  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L1_error)
6671  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6672  __pyx_v_A_num_columns = __pyx_t_3;
6673 
6674  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":512
6675  * # Contiguity
6676  * cdef FlagType A_is_row_major
6677  * cdef FlagType B_is_row_major = 0 # <<<<<<<<<<<<<<
6678  *
6679  * if A.flags['C_CONTIGUOUS']:
6680  */
6681  __Pyx_TraceLine(512,0,__PYX_ERR(0, 512, __pyx_L1_error))
6682  __pyx_v_B_is_row_major = 0;
6683 
6684  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":514
6685  * cdef FlagType B_is_row_major = 0
6686  *
6687  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6688  * A_is_row_major = 1
6689  * elif A.flags['F_CONTIGUOUS']:
6690  */
6691  __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
6692  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
6693  __Pyx_GOTREF(__pyx_t_1);
6694  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
6695  __Pyx_GOTREF(__pyx_t_2);
6696  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6697  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 514, __pyx_L1_error)
6698  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6699  if (__pyx_t_4) {
6700 
6701  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":515
6702  *
6703  * if A.flags['C_CONTIGUOUS']:
6704  * A_is_row_major = 1 # <<<<<<<<<<<<<<
6705  * elif A.flags['F_CONTIGUOUS']:
6706  * A_is_row_major = 0
6707  */
6708  __Pyx_TraceLine(515,0,__PYX_ERR(0, 515, __pyx_L1_error))
6709  __pyx_v_A_is_row_major = 1;
6710 
6711  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":514
6712  * cdef FlagType B_is_row_major = 0
6713  *
6714  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6715  * A_is_row_major = 1
6716  * elif A.flags['F_CONTIGUOUS']:
6717  */
6718  goto __pyx_L3;
6719  }
6720 
6721  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":516
6722  * if A.flags['C_CONTIGUOUS']:
6723  * A_is_row_major = 1
6724  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6725  * A_is_row_major = 0
6726  * else:
6727  */
6728  __Pyx_TraceLine(516,0,__PYX_ERR(0, 516, __pyx_L1_error))
6729  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
6730  __Pyx_GOTREF(__pyx_t_2);
6731  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
6732  __Pyx_GOTREF(__pyx_t_1);
6733  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6734  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
6735  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6736  if (likely(__pyx_t_4)) {
6737 
6738  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":517
6739  * A_is_row_major = 1
6740  * elif A.flags['F_CONTIGUOUS']:
6741  * A_is_row_major = 0 # <<<<<<<<<<<<<<
6742  * else:
6743  * raise TypeError('Matrix A should be either C or F contiguous.')
6744  */
6745  __Pyx_TraceLine(517,0,__PYX_ERR(0, 517, __pyx_L1_error))
6746  __pyx_v_A_is_row_major = 0;
6747 
6748  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":516
6749  * if A.flags['C_CONTIGUOUS']:
6750  * A_is_row_major = 1
6751  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6752  * A_is_row_major = 0
6753  * else:
6754  */
6755  goto __pyx_L3;
6756  }
6757 
6758  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":519
6759  * A_is_row_major = 0
6760  * else:
6761  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
6762  *
6763  * if not B_is_identity:
6764  */
6765  __Pyx_TraceLine(519,0,__PYX_ERR(0, 519, __pyx_L1_error))
6766  /*else*/ {
6767  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
6768  __Pyx_GOTREF(__pyx_t_1);
6769  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6770  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6771  __PYX_ERR(0, 519, __pyx_L1_error)
6772  }
6773  __pyx_L3:;
6774 
6775  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":521
6776  * raise TypeError('Matrix A should be either C or F contiguous.')
6777  *
6778  * if not B_is_identity: # <<<<<<<<<<<<<<
6779  * if B.flags['C_CONTIGUOUS']:
6780  * B_is_row_major = 1
6781  */
6782  __Pyx_TraceLine(521,0,__PYX_ERR(0, 521, __pyx_L1_error))
6783  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
6784  __pyx_t_5 = ((!__pyx_t_4) != 0);
6785  if (__pyx_t_5) {
6786 
6787  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":522
6788  *
6789  * if not B_is_identity:
6790  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6791  * B_is_row_major = 1
6792  * elif B.flags['F_CONTIGUOUS']:
6793  */
6794  __Pyx_TraceLine(522,0,__PYX_ERR(0, 522, __pyx_L1_error))
6795  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
6796  __Pyx_GOTREF(__pyx_t_1);
6797  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
6798  __Pyx_GOTREF(__pyx_t_2);
6799  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6800  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
6801  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6802  if (__pyx_t_5) {
6803 
6804  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":523
6805  * if not B_is_identity:
6806  * if B.flags['C_CONTIGUOUS']:
6807  * B_is_row_major = 1 # <<<<<<<<<<<<<<
6808  * elif B.flags['F_CONTIGUOUS']:
6809  * B_is_row_major = 0
6810  */
6811  __Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L1_error))
6812  __pyx_v_B_is_row_major = 1;
6813 
6814  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":522
6815  *
6816  * if not B_is_identity:
6817  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6818  * B_is_row_major = 1
6819  * elif B.flags['F_CONTIGUOUS']:
6820  */
6821  goto __pyx_L5;
6822  }
6823 
6824  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":524
6825  * if B.flags['C_CONTIGUOUS']:
6826  * B_is_row_major = 1
6827  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6828  * B_is_row_major = 0
6829  * else:
6830  */
6831  __Pyx_TraceLine(524,0,__PYX_ERR(0, 524, __pyx_L1_error))
6832  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
6833  __Pyx_GOTREF(__pyx_t_2);
6834  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
6835  __Pyx_GOTREF(__pyx_t_1);
6836  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6837  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
6838  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6839  if (likely(__pyx_t_5)) {
6840 
6841  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":525
6842  * B_is_row_major = 1
6843  * elif B.flags['F_CONTIGUOUS']:
6844  * B_is_row_major = 0 # <<<<<<<<<<<<<<
6845  * else:
6846  * raise TypeError('Matrix B should be either C or F contiguous.')
6847  */
6848  __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
6849  __pyx_v_B_is_row_major = 0;
6850 
6851  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":524
6852  * if B.flags['C_CONTIGUOUS']:
6853  * B_is_row_major = 1
6854  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6855  * B_is_row_major = 0
6856  * else:
6857  */
6858  goto __pyx_L5;
6859  }
6860 
6861  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":527
6862  * B_is_row_major = 0
6863  * else:
6864  * raise TypeError('Matrix B should be either C or F contiguous.') # <<<<<<<<<<<<<<
6865  *
6866  * # Declare memoryviews to get data pointer
6867  */
6868  __Pyx_TraceLine(527,0,__PYX_ERR(0, 527, __pyx_L1_error))
6869  /*else*/ {
6870  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
6871  __Pyx_GOTREF(__pyx_t_1);
6872  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6873  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6874  __PYX_ERR(0, 527, __pyx_L1_error)
6875  }
6876  __pyx_L5:;
6877 
6878  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":521
6879  * raise TypeError('Matrix A should be either C or F contiguous.')
6880  *
6881  * if not B_is_identity: # <<<<<<<<<<<<<<
6882  * if B.flags['C_CONTIGUOUS']:
6883  * B_is_row_major = 1
6884  */
6885  }
6886 
6887  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":532
6888  * cdef long double[:, ::1] A_data_mv_c
6889  * cdef long double[::1, :] A_data_mv_f
6890  * cdef long double[:, ::1] B_data_mv_c = None # <<<<<<<<<<<<<<
6891  * cdef long double[::1, :] B_data_mv_f = None
6892  *
6893  */
6894  __Pyx_TraceLine(532,0,__PYX_ERR(0, 532, __pyx_L1_error))
6895  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 532, __pyx_L1_error)
6896  __pyx_v_B_data_mv_c = __pyx_t_6;
6897  __pyx_t_6.memview = NULL;
6898  __pyx_t_6.data = NULL;
6899 
6900  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":533
6901  * cdef long double[::1, :] A_data_mv_f
6902  * cdef long double[:, ::1] B_data_mv_c = None
6903  * cdef long double[::1, :] B_data_mv_f = None # <<<<<<<<<<<<<<
6904  *
6905  * # Declare pointer to A.data and B.data
6906  */
6907  __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error))
6908  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 533, __pyx_L1_error)
6909  __pyx_v_B_data_mv_f = __pyx_t_7;
6910  __pyx_t_7.memview = NULL;
6911  __pyx_t_7.data = NULL;
6912 
6913  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":537
6914  * # Declare pointer to A.data and B.data
6915  * cdef long double* A_data
6916  * cdef long double* B_data = NULL # <<<<<<<<<<<<<<
6917  *
6918  * # Get pointer to data of A depending on row or column major
6919  */
6920  __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error))
6921  __pyx_v_B_data = NULL;
6922 
6923  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":540
6924  *
6925  * # Get pointer to data of A depending on row or column major
6926  * if A_is_row_major: # <<<<<<<<<<<<<<
6927  *
6928  * # Memoryview of A for row major matrix
6929  */
6930  __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
6931  __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
6932  if (__pyx_t_5) {
6933 
6934  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":543
6935  *
6936  * # Memoryview of A for row major matrix
6937  * A_data_mv_c = A # <<<<<<<<<<<<<<
6938  *
6939  * # Pointer of the data of A
6940  */
6941  __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
6942  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 543, __pyx_L1_error)
6943  __pyx_v_A_data_mv_c = __pyx_t_6;
6944  __pyx_t_6.memview = NULL;
6945  __pyx_t_6.data = NULL;
6946 
6947  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":546
6948  *
6949  * # Pointer of the data of A
6950  * A_data = &A_data_mv_c[0, 0] # <<<<<<<<<<<<<<
6951  *
6952  * else:
6953  */
6954  __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
6955  __pyx_t_8 = 0;
6956  __pyx_t_9 = 0;
6957  __pyx_v_A_data = (&(*((long double *) ( /* dim=1 */ ((char *) (((long double *) ( /* dim=0 */ (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6958 
6959  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":540
6960  *
6961  * # Get pointer to data of A depending on row or column major
6962  * if A_is_row_major: # <<<<<<<<<<<<<<
6963  *
6964  * # Memoryview of A for row major matrix
6965  */
6966  goto __pyx_L6;
6967  }
6968 
6969  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":551
6970  *
6971  * # Memoryview of A for column major matrix
6972  * A_data_mv_f = A # <<<<<<<<<<<<<<
6973  *
6974  * # Pointer of the data of A
6975  */
6976  __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
6977  /*else*/ {
6978  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 551, __pyx_L1_error)
6979  __pyx_v_A_data_mv_f = __pyx_t_7;
6980  __pyx_t_7.memview = NULL;
6981  __pyx_t_7.data = NULL;
6982 
6983  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":554
6984  *
6985  * # Pointer of the data of A
6986  * A_data = &A_data_mv_f[0, 0] # <<<<<<<<<<<<<<
6987  *
6988  * # Get pointer to data of AB depending on row or column major
6989  */
6990  __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error))
6991  __pyx_t_9 = 0;
6992  __pyx_t_8 = 0;
6993  __pyx_v_A_data = (&(*((long double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((long double *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
6994  }
6995  __pyx_L6:;
6996 
6997  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":557
6998  *
6999  * # Get pointer to data of AB depending on row or column major
7000  * if not B_is_identity: # <<<<<<<<<<<<<<
7001  * if B_is_row_major:
7002  *
7003  */
7004  __Pyx_TraceLine(557,0,__PYX_ERR(0, 557, __pyx_L1_error))
7005  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 557, __pyx_L1_error)
7006  __pyx_t_4 = ((!__pyx_t_5) != 0);
7007  if (__pyx_t_4) {
7008 
7009  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":558
7010  * # Get pointer to data of AB depending on row or column major
7011  * if not B_is_identity:
7012  * if B_is_row_major: # <<<<<<<<<<<<<<
7013  *
7014  * # Memoryview of A for row major matrix
7015  */
7016  __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
7017  __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
7018  if (__pyx_t_4) {
7019 
7020  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":561
7021  *
7022  * # Memoryview of A for row major matrix
7023  * B_data_mv_c = B # <<<<<<<<<<<<<<
7024  *
7025  * # Pointer of the data of A
7026  */
7027  __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
7028  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 561, __pyx_L1_error)
7029  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
7030  __pyx_v_B_data_mv_c = __pyx_t_6;
7031  __pyx_t_6.memview = NULL;
7032  __pyx_t_6.data = NULL;
7033 
7034  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":564
7035  *
7036  * # Pointer of the data of A
7037  * B_data = &B_data_mv_c[0, 0] # <<<<<<<<<<<<<<
7038  *
7039  * else:
7040  */
7041  __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error))
7042  __pyx_t_8 = 0;
7043  __pyx_t_9 = 0;
7044  __pyx_v_B_data = (&(*((long double *) ( /* dim=1 */ ((char *) (((long double *) ( /* dim=0 */ (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
7045 
7046  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":558
7047  * # Get pointer to data of AB depending on row or column major
7048  * if not B_is_identity:
7049  * if B_is_row_major: # <<<<<<<<<<<<<<
7050  *
7051  * # Memoryview of A for row major matrix
7052  */
7053  goto __pyx_L8;
7054  }
7055 
7056  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":569
7057  *
7058  * # Memoryview of A for column major matrix
7059  * B_data_mv_f = B # <<<<<<<<<<<<<<
7060  *
7061  * # Pointer of the data of B
7062  */
7063  __Pyx_TraceLine(569,0,__PYX_ERR(0, 569, __pyx_L1_error))
7064  /*else*/ {
7065  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 569, __pyx_L1_error)
7066  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
7067  __pyx_v_B_data_mv_f = __pyx_t_7;
7068  __pyx_t_7.memview = NULL;
7069  __pyx_t_7.data = NULL;
7070 
7071  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":572
7072  *
7073  * # Pointer of the data of B
7074  * B_data = &B_data_mv_f[0, 0] # <<<<<<<<<<<<<<
7075  *
7076  * # Create a linear operator object
7077  */
7078  __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
7079  __pyx_t_9 = 0;
7080  __pyx_t_8 = 0;
7081  __pyx_v_B_data = (&(*((long double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((long double *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
7082  }
7083  __pyx_L8:;
7084 
7085  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":557
7086  *
7087  * # Get pointer to data of AB depending on row or column major
7088  * if not B_is_identity: # <<<<<<<<<<<<<<
7089  * if B_is_row_major:
7090  *
7091  */
7092  }
7093 
7094  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":575
7095  *
7096  * # Create a linear operator object
7097  * if B_is_identity: # <<<<<<<<<<<<<<
7098  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double](
7099  * A_data,
7100  */
7101  __Pyx_TraceLine(575,0,__PYX_ERR(0, 575, __pyx_L1_error))
7102  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 575, __pyx_L1_error)
7103  if (__pyx_t_4) {
7104 
7105  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":576
7106  * # Create a linear operator object
7107  * if B_is_identity:
7108  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
7109  * A_data,
7110  * A_is_row_major,
7111  */
7112  __Pyx_TraceLine(576,0,__PYX_ERR(0, 576, __pyx_L1_error))
7113  try {
7114  __pyx_t_10 = new cDenseAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
7115  } catch(...) {
7116  __Pyx_CppExn2PyErr();
7117  __PYX_ERR(0, 576, __pyx_L1_error)
7118  }
7119  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_10;
7120 
7121  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":575
7122  *
7123  * # Create a linear operator object
7124  * if B_is_identity: # <<<<<<<<<<<<<<
7125  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double](
7126  * A_data,
7127  */
7128  goto __pyx_L9;
7129  }
7130 
7131  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":582
7132  * A_num_columns)
7133  * else:
7134  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
7135  * A_data,
7136  * A_is_row_major,
7137  */
7138  __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error))
7139  /*else*/ {
7140 
7141  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":588
7142  * A_num_columns,
7143  * B_data,
7144  * B_is_row_major) # <<<<<<<<<<<<<<
7145  *
7146  * # ====================
7147  */
7148  __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
7149  try {
7150  __pyx_t_10 = new cDenseAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
7151  } catch(...) {
7152  __Pyx_CppExn2PyErr();
7153  __PYX_ERR(0, 582, __pyx_L1_error)
7154  }
7155 
7156  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":582
7157  * A_num_columns)
7158  * else:
7159  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
7160  * A_data,
7161  * A_is_row_major,
7162  */
7163  __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error))
7164  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_10;
7165  }
7166  __pyx_L9:;
7167 
7168  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":498
7169  * # ============================
7170  *
7171  * def set_dense_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
7172  * """
7173  * Sets matrix A.
7174  */
7175 
7176  /* function exit code */
7177  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7178  goto __pyx_L0;
7179  __pyx_L1_error:;
7180  __Pyx_XDECREF(__pyx_t_1);
7181  __Pyx_XDECREF(__pyx_t_2);
7182  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
7183  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
7184  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
7185  __pyx_r = NULL;
7186  __pyx_L0:;
7187  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
7188  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
7189  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
7190  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
7191  __Pyx_XGIVEREF(__pyx_r);
7192  __Pyx_TraceReturn(__pyx_r, 0);
7193  __Pyx_RefNannyFinishContext();
7194  return __pyx_r;
7195 }
7196 
7197 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":594
7198  * # ====================
7199  *
7200  * def set_csr_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
7201  * """
7202  * """
7203  */
7204 
7205 /* Python wrapper */
7206 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7207 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float[] = "pycAffineMatrixFunction.set_csr_matrix_float(self, A, B, B_is_identity)\n\n ";
7208 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float = {"set_csr_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float};
7209 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7210  PyObject *__pyx_v_A = 0;
7211  PyObject *__pyx_v_B = 0;
7212  PyObject *__pyx_v_B_is_identity = 0;
7213  int __pyx_lineno = 0;
7214  const char *__pyx_filename = NULL;
7215  int __pyx_clineno = 0;
7216  PyObject *__pyx_r = 0;
7217  __Pyx_RefNannyDeclarations
7218  __Pyx_RefNannySetupContext("set_csr_matrix_float (wrapper)", 0);
7219  {
7220  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
7221  PyObject* values[3] = {0,0,0};
7222  if (unlikely(__pyx_kwds)) {
7223  Py_ssize_t kw_args;
7224  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7225  switch (pos_args) {
7226  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7227  CYTHON_FALLTHROUGH;
7228  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7229  CYTHON_FALLTHROUGH;
7230  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7231  CYTHON_FALLTHROUGH;
7232  case 0: break;
7233  default: goto __pyx_L5_argtuple_error;
7234  }
7235  kw_args = PyDict_Size(__pyx_kwds);
7236  switch (pos_args) {
7237  case 0:
7238  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
7239  else goto __pyx_L5_argtuple_error;
7240  CYTHON_FALLTHROUGH;
7241  case 1:
7242  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
7243  else {
7244  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 594, __pyx_L3_error)
7245  }
7246  CYTHON_FALLTHROUGH;
7247  case 2:
7248  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
7249  else {
7250  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 594, __pyx_L3_error)
7251  }
7252  }
7253  if (unlikely(kw_args > 0)) {
7254  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csr_matrix_float") < 0)) __PYX_ERR(0, 594, __pyx_L3_error)
7255  }
7256  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7257  goto __pyx_L5_argtuple_error;
7258  } else {
7259  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7260  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7261  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7262  }
7263  __pyx_v_A = values[0];
7264  __pyx_v_B = values[1];
7265  __pyx_v_B_is_identity = values[2];
7266  }
7267  goto __pyx_L4_argument_unpacking_done;
7268  __pyx_L5_argtuple_error:;
7269  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 594, __pyx_L3_error)
7270  __pyx_L3_error:;
7271  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
7272  __Pyx_RefNannyFinishContext();
7273  return NULL;
7274  __pyx_L4_argument_unpacking_done:;
7275  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
7276 
7277  /* function exit code */
7278  __Pyx_RefNannyFinishContext();
7279  return __pyx_r;
7280 }
7281 
7282 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
7283  LongIndexType __pyx_v_A_num_rows;
7284  LongIndexType __pyx_v_A_num_columns;
7285  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7286  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7287  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7288  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7289  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7290  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7291  float *__pyx_v_A_data;
7292  LongIndexType *__pyx_v_A_indices;
7293  LongIndexType *__pyx_v_A_index_pointer;
7294  float *__pyx_v_B_data;
7295  LongIndexType *__pyx_v_B_indices;
7296  LongIndexType *__pyx_v_B_index_pointer;
7297  PyObject *__pyx_r = NULL;
7298  __Pyx_TraceDeclarations
7299  __Pyx_RefNannyDeclarations
7300  PyObject *__pyx_t_1 = NULL;
7301  PyObject *__pyx_t_2 = NULL;
7302  LongIndexType __pyx_t_3;
7303  PyObject *__pyx_t_4 = NULL;
7304  PyObject *__pyx_t_5 = NULL;
7305  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
7306  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
7307  int __pyx_t_8;
7308  int __pyx_t_9;
7309  Py_ssize_t __pyx_t_10;
7310  cCSRAffineMatrixFunction<float> *__pyx_t_11;
7311  int __pyx_lineno = 0;
7312  const char *__pyx_filename = NULL;
7313  int __pyx_clineno = 0;
7314  __Pyx_TraceFrameInit(__pyx_codeobj__12)
7315  __Pyx_RefNannySetupContext("set_csr_matrix_float", 0);
7316  __Pyx_TraceCall("set_csr_matrix_float", __pyx_f[0], 594, 0, __PYX_ERR(0, 594, __pyx_L1_error));
7317 
7318  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":599
7319  *
7320  * # Matrix size
7321  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
7322  * cdef LongIndexType A_num_columns = A.shape[1]
7323  *
7324  */
7325  __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
7326  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
7327  __Pyx_GOTREF(__pyx_t_1);
7328  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error)
7329  __Pyx_GOTREF(__pyx_t_2);
7330  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7331  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error)
7332  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7333  __pyx_v_A_num_rows = __pyx_t_3;
7334 
7335  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":600
7336  * # Matrix size
7337  * cdef LongIndexType A_num_rows = A.shape[0]
7338  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
7339  *
7340  * # If the input type is the same as LongIndexType, no copy is performed.
7341  */
7342  __Pyx_TraceLine(600,0,__PYX_ERR(0, 600, __pyx_L1_error))
7343  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error)
7344  __Pyx_GOTREF(__pyx_t_2);
7345  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error)
7346  __Pyx_GOTREF(__pyx_t_1);
7347  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7348  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error)
7349  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7350  __pyx_v_A_num_columns = __pyx_t_3;
7351 
7352  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":604
7353  * # If the input type is the same as LongIndexType, no copy is performed.
7354  * self.A_indices_copy = \
7355  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7356  * self.A_index_pointer_copy = \
7357  * A.indptr.astype(self.long_index_type_name, copy=False)
7358  */
7359  __Pyx_TraceLine(604,0,__PYX_ERR(0, 604, __pyx_L1_error))
7360  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7361  __Pyx_GOTREF(__pyx_t_1);
7362  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
7363  __Pyx_GOTREF(__pyx_t_2);
7364  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7365  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7366  __Pyx_GOTREF(__pyx_t_1);
7367  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
7368  __Pyx_GOTREF(__pyx_t_4);
7369  __Pyx_GIVEREF(__pyx_t_1);
7370  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7371  __pyx_t_1 = 0;
7372  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7373  __Pyx_GOTREF(__pyx_t_1);
7374  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
7375  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error)
7376  __Pyx_GOTREF(__pyx_t_5);
7377  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7378  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7379  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7380 
7381  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":603
7382  *
7383  * # If the input type is the same as LongIndexType, no copy is performed.
7384  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
7385  * A.indices.astype(self.long_index_type_name, copy=False)
7386  * self.A_index_pointer_copy = \
7387  */
7388  __Pyx_TraceLine(603,0,__PYX_ERR(0, 603, __pyx_L1_error))
7389  __Pyx_GIVEREF(__pyx_t_5);
7390  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
7391  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
7392  __pyx_v_self->A_indices_copy = __pyx_t_5;
7393  __pyx_t_5 = 0;
7394 
7395  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":606
7396  * A.indices.astype(self.long_index_type_name, copy=False)
7397  * self.A_index_pointer_copy = \
7398  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7399  *
7400  * # Declare memoryviews to get pointers
7401  */
7402  __Pyx_TraceLine(606,0,__PYX_ERR(0, 606, __pyx_L1_error))
7403  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7404  __Pyx_GOTREF(__pyx_t_5);
7405  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
7406  __Pyx_GOTREF(__pyx_t_1);
7407  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7408  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7409  __Pyx_GOTREF(__pyx_t_5);
7410  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
7411  __Pyx_GOTREF(__pyx_t_4);
7412  __Pyx_GIVEREF(__pyx_t_5);
7413  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7414  __pyx_t_5 = 0;
7415  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7416  __Pyx_GOTREF(__pyx_t_5);
7417  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
7418  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
7419  __Pyx_GOTREF(__pyx_t_2);
7420  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7421  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7422  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7423 
7424  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":605
7425  * self.A_indices_copy = \
7426  * A.indices.astype(self.long_index_type_name, copy=False)
7427  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
7428  * A.indptr.astype(self.long_index_type_name, copy=False)
7429  *
7430  */
7431  __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
7432  __Pyx_GIVEREF(__pyx_t_2);
7433  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
7434  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
7435  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
7436  __pyx_t_2 = 0;
7437 
7438  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":609
7439  *
7440  * # Declare memoryviews to get pointers
7441  * cdef float[:] A_data_mv = A.data # <<<<<<<<<<<<<<
7442  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
7443  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7444  */
7445  __Pyx_TraceLine(609,0,__PYX_ERR(0, 609, __pyx_L1_error))
7446  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
7447  __Pyx_GOTREF(__pyx_t_2);
7448  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 609, __pyx_L1_error)
7449  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7450  __pyx_v_A_data_mv = __pyx_t_6;
7451  __pyx_t_6.memview = NULL;
7452  __pyx_t_6.data = NULL;
7453 
7454  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":610
7455  * # Declare memoryviews to get pointers
7456  * cdef float[:] A_data_mv = A.data
7457  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
7458  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7459  * self.A_index_pointer_copy
7460  */
7461  __Pyx_TraceLine(610,0,__PYX_ERR(0, 610, __pyx_L1_error))
7462  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 610, __pyx_L1_error)
7463  __pyx_v_A_indices_mv = __pyx_t_7;
7464  __pyx_t_7.memview = NULL;
7465  __pyx_t_7.data = NULL;
7466 
7467  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":612
7468  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
7469  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7470  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
7471  * cdef float[:] B_data_mv = None
7472  * cdef MemoryViewLongIndexType B_indices_mv = None
7473  */
7474  __Pyx_TraceLine(612,0,__PYX_ERR(0, 612, __pyx_L1_error))
7475  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 612, __pyx_L1_error)
7476  __pyx_v_A_index_pointer_mv = __pyx_t_7;
7477  __pyx_t_7.memview = NULL;
7478  __pyx_t_7.data = NULL;
7479 
7480  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":613
7481  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7482  * self.A_index_pointer_copy
7483  * cdef float[:] B_data_mv = None # <<<<<<<<<<<<<<
7484  * cdef MemoryViewLongIndexType B_indices_mv = None
7485  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7486  */
7487  __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error))
7488  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 613, __pyx_L1_error)
7489  __pyx_v_B_data_mv = __pyx_t_6;
7490  __pyx_t_6.memview = NULL;
7491  __pyx_t_6.data = NULL;
7492 
7493  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":614
7494  * self.A_index_pointer_copy
7495  * cdef float[:] B_data_mv = None
7496  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
7497  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7498  *
7499  */
7500  __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error))
7501  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 614, __pyx_L1_error)
7502  __pyx_v_B_indices_mv = __pyx_t_7;
7503  __pyx_t_7.memview = NULL;
7504  __pyx_t_7.data = NULL;
7505 
7506  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":615
7507  * cdef float[:] B_data_mv = None
7508  * cdef MemoryViewLongIndexType B_indices_mv = None
7509  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
7510  *
7511  * if not B_is_identity:
7512  */
7513  __Pyx_TraceLine(615,0,__PYX_ERR(0, 615, __pyx_L1_error))
7514  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 615, __pyx_L1_error)
7515  __pyx_v_B_index_pointer_mv = __pyx_t_7;
7516  __pyx_t_7.memview = NULL;
7517  __pyx_t_7.data = NULL;
7518 
7519  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":617
7520  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7521  *
7522  * if not B_is_identity: # <<<<<<<<<<<<<<
7523  *
7524  * # If input type is the same as LongIndexType, no copy is performed.
7525  */
7526  __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error))
7527  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
7528  __pyx_t_9 = ((!__pyx_t_8) != 0);
7529  if (__pyx_t_9) {
7530 
7531  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":621
7532  * # If input type is the same as LongIndexType, no copy is performed.
7533  * self.B_indices_copy = \
7534  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7535  * self.B_index_pointer_copy = \
7536  * B.indptr.astype(self.long_index_type_name, copy=False)
7537  */
7538  __Pyx_TraceLine(621,0,__PYX_ERR(0, 621, __pyx_L1_error))
7539  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7540  __Pyx_GOTREF(__pyx_t_2);
7541  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 621, __pyx_L1_error)
7542  __Pyx_GOTREF(__pyx_t_5);
7543  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7544  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7545  __Pyx_GOTREF(__pyx_t_2);
7546  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
7547  __Pyx_GOTREF(__pyx_t_4);
7548  __Pyx_GIVEREF(__pyx_t_2);
7549  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
7550  __pyx_t_2 = 0;
7551  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7552  __Pyx_GOTREF(__pyx_t_2);
7553  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
7554  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
7555  __Pyx_GOTREF(__pyx_t_1);
7556  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7557  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7558  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7559 
7560  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":620
7561  *
7562  * # If input type is the same as LongIndexType, no copy is performed.
7563  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
7564  * B.indices.astype(self.long_index_type_name, copy=False)
7565  * self.B_index_pointer_copy = \
7566  */
7567  __Pyx_TraceLine(620,0,__PYX_ERR(0, 620, __pyx_L1_error))
7568  __Pyx_GIVEREF(__pyx_t_1);
7569  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
7570  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
7571  __pyx_v_self->B_indices_copy = __pyx_t_1;
7572  __pyx_t_1 = 0;
7573 
7574  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":623
7575  * B.indices.astype(self.long_index_type_name, copy=False)
7576  * self.B_index_pointer_copy = \
7577  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7578  *
7579  * B_data_mv = B.data
7580  */
7581  __Pyx_TraceLine(623,0,__PYX_ERR(0, 623, __pyx_L1_error))
7582  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7583  __Pyx_GOTREF(__pyx_t_1);
7584  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
7585  __Pyx_GOTREF(__pyx_t_2);
7586  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7587  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7588  __Pyx_GOTREF(__pyx_t_1);
7589  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
7590  __Pyx_GOTREF(__pyx_t_4);
7591  __Pyx_GIVEREF(__pyx_t_1);
7592  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7593  __pyx_t_1 = 0;
7594  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7595  __Pyx_GOTREF(__pyx_t_1);
7596  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
7597  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
7598  __Pyx_GOTREF(__pyx_t_5);
7599  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7600  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7601  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7602 
7603  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":622
7604  * self.B_indices_copy = \
7605  * B.indices.astype(self.long_index_type_name, copy=False)
7606  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
7607  * B.indptr.astype(self.long_index_type_name, copy=False)
7608  *
7609  */
7610  __Pyx_TraceLine(622,0,__PYX_ERR(0, 622, __pyx_L1_error))
7611  __Pyx_GIVEREF(__pyx_t_5);
7612  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
7613  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
7614  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
7615  __pyx_t_5 = 0;
7616 
7617  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":625
7618  * B.indptr.astype(self.long_index_type_name, copy=False)
7619  *
7620  * B_data_mv = B.data # <<<<<<<<<<<<<<
7621  * B_indices_mv = self.B_indices_copy
7622  * B_index_pointer_mv = self.B_index_pointer_copy
7623  */
7624  __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
7625  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error)
7626  __Pyx_GOTREF(__pyx_t_5);
7627  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 625, __pyx_L1_error)
7628  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7629  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
7630  __pyx_v_B_data_mv = __pyx_t_6;
7631  __pyx_t_6.memview = NULL;
7632  __pyx_t_6.data = NULL;
7633 
7634  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":626
7635  *
7636  * B_data_mv = B.data
7637  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
7638  * B_index_pointer_mv = self.B_index_pointer_copy
7639  *
7640  */
7641  __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error))
7642  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 626, __pyx_L1_error)
7643  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
7644  __pyx_v_B_indices_mv = __pyx_t_7;
7645  __pyx_t_7.memview = NULL;
7646  __pyx_t_7.data = NULL;
7647 
7648  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":627
7649  * B_data_mv = B.data
7650  * B_indices_mv = self.B_indices_copy
7651  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
7652  *
7653  * # Declare pointers
7654  */
7655  __Pyx_TraceLine(627,0,__PYX_ERR(0, 627, __pyx_L1_error))
7656  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 627, __pyx_L1_error)
7657  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
7658  __pyx_v_B_index_pointer_mv = __pyx_t_7;
7659  __pyx_t_7.memview = NULL;
7660  __pyx_t_7.data = NULL;
7661 
7662  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":617
7663  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7664  *
7665  * if not B_is_identity: # <<<<<<<<<<<<<<
7666  *
7667  * # If input type is the same as LongIndexType, no copy is performed.
7668  */
7669  }
7670 
7671  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":630
7672  *
7673  * # Declare pointers
7674  * cdef float* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
7675  * cdef LongIndexType* A_indices = &A_indices_mv[0]
7676  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
7677  */
7678  __Pyx_TraceLine(630,0,__PYX_ERR(0, 630, __pyx_L1_error))
7679  __pyx_t_10 = 0;
7680  __pyx_v_A_data = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
7681 
7682  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":631
7683  * # Declare pointers
7684  * cdef float* A_data = &A_data_mv[0]
7685  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
7686  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
7687  * cdef float* B_data = NULL
7688  */
7689  __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error))
7690  __pyx_t_10 = 0;
7691  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
7692 
7693  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":632
7694  * cdef float* A_data = &A_data_mv[0]
7695  * cdef LongIndexType* A_indices = &A_indices_mv[0]
7696  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
7697  * cdef float* B_data = NULL
7698  * cdef LongIndexType* B_indices = NULL
7699  */
7700  __Pyx_TraceLine(632,0,__PYX_ERR(0, 632, __pyx_L1_error))
7701  __pyx_t_10 = 0;
7702  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
7703 
7704  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":633
7705  * cdef LongIndexType* A_indices = &A_indices_mv[0]
7706  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
7707  * cdef float* B_data = NULL # <<<<<<<<<<<<<<
7708  * cdef LongIndexType* B_indices = NULL
7709  * cdef LongIndexType* B_index_pointer = NULL
7710  */
7711  __Pyx_TraceLine(633,0,__PYX_ERR(0, 633, __pyx_L1_error))
7712  __pyx_v_B_data = NULL;
7713 
7714  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":634
7715  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
7716  * cdef float* B_data = NULL
7717  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
7718  * cdef LongIndexType* B_index_pointer = NULL
7719  *
7720  */
7721  __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
7722  __pyx_v_B_indices = NULL;
7723 
7724  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":635
7725  * cdef float* B_data = NULL
7726  * cdef LongIndexType* B_indices = NULL
7727  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
7728  *
7729  * if not B_is_identity:
7730  */
7731  __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
7732  __pyx_v_B_index_pointer = NULL;
7733 
7734  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":637
7735  * cdef LongIndexType* B_index_pointer = NULL
7736  *
7737  * if not B_is_identity: # <<<<<<<<<<<<<<
7738  * B_data = &B_data_mv[0]
7739  * B_indices = &B_indices_mv[0]
7740  */
7741  __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
7742  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
7743  __pyx_t_8 = ((!__pyx_t_9) != 0);
7744  if (__pyx_t_8) {
7745 
7746  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":638
7747  *
7748  * if not B_is_identity:
7749  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
7750  * B_indices = &B_indices_mv[0]
7751  * B_index_pointer = &B_index_pointer_mv[0]
7752  */
7753  __Pyx_TraceLine(638,0,__PYX_ERR(0, 638, __pyx_L1_error))
7754  __pyx_t_10 = 0;
7755  __pyx_v_B_data = (&(*((float *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
7756 
7757  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":639
7758  * if not B_is_identity:
7759  * B_data = &B_data_mv[0]
7760  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
7761  * B_index_pointer = &B_index_pointer_mv[0]
7762  *
7763  */
7764  __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error))
7765  __pyx_t_10 = 0;
7766  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
7767 
7768  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":640
7769  * B_data = &B_data_mv[0]
7770  * B_indices = &B_indices_mv[0]
7771  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
7772  *
7773  * # Create a linear operator object
7774  */
7775  __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
7776  __pyx_t_10 = 0;
7777  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
7778 
7779  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":637
7780  * cdef LongIndexType* B_index_pointer = NULL
7781  *
7782  * if not B_is_identity: # <<<<<<<<<<<<<<
7783  * B_data = &B_data_mv[0]
7784  * B_indices = &B_indices_mv[0]
7785  */
7786  }
7787 
7788  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":643
7789  *
7790  * # Create a linear operator object
7791  * if B_is_identity: # <<<<<<<<<<<<<<
7792  * self.Aop_float = new cCSRAffineMatrixFunction[float](
7793  * A_data,
7794  */
7795  __Pyx_TraceLine(643,0,__PYX_ERR(0, 643, __pyx_L1_error))
7796  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
7797  if (__pyx_t_8) {
7798 
7799  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":644
7800  * # Create a linear operator object
7801  * if B_is_identity:
7802  * self.Aop_float = new cCSRAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
7803  * A_data,
7804  * A_indices,
7805  */
7806  __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error))
7807  try {
7808  __pyx_t_11 = new cCSRAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
7809  } catch(...) {
7810  __Pyx_CppExn2PyErr();
7811  __PYX_ERR(0, 644, __pyx_L1_error)
7812  }
7813  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
7814 
7815  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":643
7816  *
7817  * # Create a linear operator object
7818  * if B_is_identity: # <<<<<<<<<<<<<<
7819  * self.Aop_float = new cCSRAffineMatrixFunction[float](
7820  * A_data,
7821  */
7822  goto __pyx_L5;
7823  }
7824 
7825  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":651
7826  * A_num_columns)
7827  * else:
7828  * self.Aop_float = new cCSRAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
7829  * A_data,
7830  * A_indices,
7831  */
7832  __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error))
7833  /*else*/ {
7834 
7835  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":659
7836  * B_data,
7837  * B_indices,
7838  * B_index_pointer) # <<<<<<<<<<<<<<
7839  *
7840  * # =====================
7841  */
7842  __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error))
7843  try {
7844  __pyx_t_11 = new cCSRAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
7845  } catch(...) {
7846  __Pyx_CppExn2PyErr();
7847  __PYX_ERR(0, 651, __pyx_L1_error)
7848  }
7849 
7850  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":651
7851  * A_num_columns)
7852  * else:
7853  * self.Aop_float = new cCSRAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
7854  * A_data,
7855  * A_indices,
7856  */
7857  __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error))
7858  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
7859  }
7860  __pyx_L5:;
7861 
7862  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":594
7863  * # ====================
7864  *
7865  * def set_csr_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
7866  * """
7867  * """
7868  */
7869 
7870  /* function exit code */
7871  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7872  goto __pyx_L0;
7873  __pyx_L1_error:;
7874  __Pyx_XDECREF(__pyx_t_1);
7875  __Pyx_XDECREF(__pyx_t_2);
7876  __Pyx_XDECREF(__pyx_t_4);
7877  __Pyx_XDECREF(__pyx_t_5);
7878  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
7879  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
7880  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
7881  __pyx_r = NULL;
7882  __pyx_L0:;
7883  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
7884  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
7885  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
7886  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
7887  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
7888  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
7889  __Pyx_XGIVEREF(__pyx_r);
7890  __Pyx_TraceReturn(__pyx_r, 0);
7891  __Pyx_RefNannyFinishContext();
7892  return __pyx_r;
7893 }
7894 
7895 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":665
7896  * # =====================
7897  *
7898  * def set_csr_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
7899  * """
7900  * """
7901  */
7902 
7903 /* Python wrapper */
7904 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7905 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double[] = "pycAffineMatrixFunction.set_csr_matrix_double(self, A, B, B_is_identity)\n\n ";
7906 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double = {"set_csr_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double};
7907 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7908  PyObject *__pyx_v_A = 0;
7909  PyObject *__pyx_v_B = 0;
7910  PyObject *__pyx_v_B_is_identity = 0;
7911  int __pyx_lineno = 0;
7912  const char *__pyx_filename = NULL;
7913  int __pyx_clineno = 0;
7914  PyObject *__pyx_r = 0;
7915  __Pyx_RefNannyDeclarations
7916  __Pyx_RefNannySetupContext("set_csr_matrix_double (wrapper)", 0);
7917  {
7918  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
7919  PyObject* values[3] = {0,0,0};
7920  if (unlikely(__pyx_kwds)) {
7921  Py_ssize_t kw_args;
7922  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7923  switch (pos_args) {
7924  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7925  CYTHON_FALLTHROUGH;
7926  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7927  CYTHON_FALLTHROUGH;
7928  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7929  CYTHON_FALLTHROUGH;
7930  case 0: break;
7931  default: goto __pyx_L5_argtuple_error;
7932  }
7933  kw_args = PyDict_Size(__pyx_kwds);
7934  switch (pos_args) {
7935  case 0:
7936  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
7937  else goto __pyx_L5_argtuple_error;
7938  CYTHON_FALLTHROUGH;
7939  case 1:
7940  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
7941  else {
7942  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 665, __pyx_L3_error)
7943  }
7944  CYTHON_FALLTHROUGH;
7945  case 2:
7946  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
7947  else {
7948  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 665, __pyx_L3_error)
7949  }
7950  }
7951  if (unlikely(kw_args > 0)) {
7952  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csr_matrix_double") < 0)) __PYX_ERR(0, 665, __pyx_L3_error)
7953  }
7954  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7955  goto __pyx_L5_argtuple_error;
7956  } else {
7957  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7958  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7959  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7960  }
7961  __pyx_v_A = values[0];
7962  __pyx_v_B = values[1];
7963  __pyx_v_B_is_identity = values[2];
7964  }
7965  goto __pyx_L4_argument_unpacking_done;
7966  __pyx_L5_argtuple_error:;
7967  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 665, __pyx_L3_error)
7968  __pyx_L3_error:;
7969  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
7970  __Pyx_RefNannyFinishContext();
7971  return NULL;
7972  __pyx_L4_argument_unpacking_done:;
7973  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
7974 
7975  /* function exit code */
7976  __Pyx_RefNannyFinishContext();
7977  return __pyx_r;
7978 }
7979 
7980 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
7981  LongIndexType __pyx_v_A_num_rows;
7982  LongIndexType __pyx_v_A_num_columns;
7983  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7984  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7985  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7986  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7987  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7988  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7989  double *__pyx_v_A_data;
7990  LongIndexType *__pyx_v_A_indices;
7991  LongIndexType *__pyx_v_A_index_pointer;
7992  double *__pyx_v_B_data;
7993  LongIndexType *__pyx_v_B_indices;
7994  LongIndexType *__pyx_v_B_index_pointer;
7995  PyObject *__pyx_r = NULL;
7996  __Pyx_TraceDeclarations
7997  __Pyx_RefNannyDeclarations
7998  PyObject *__pyx_t_1 = NULL;
7999  PyObject *__pyx_t_2 = NULL;
8000  LongIndexType __pyx_t_3;
8001  PyObject *__pyx_t_4 = NULL;
8002  PyObject *__pyx_t_5 = NULL;
8003  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
8004  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
8005  int __pyx_t_8;
8006  int __pyx_t_9;
8007  Py_ssize_t __pyx_t_10;
8009  int __pyx_lineno = 0;
8010  const char *__pyx_filename = NULL;
8011  int __pyx_clineno = 0;
8012  __Pyx_TraceFrameInit(__pyx_codeobj__13)
8013  __Pyx_RefNannySetupContext("set_csr_matrix_double", 0);
8014  __Pyx_TraceCall("set_csr_matrix_double", __pyx_f[0], 665, 0, __PYX_ERR(0, 665, __pyx_L1_error));
8015 
8016  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":670
8017  *
8018  * # Matrix size
8019  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
8020  * cdef LongIndexType A_num_columns = A.shape[1]
8021  *
8022  */
8023  __Pyx_TraceLine(670,0,__PYX_ERR(0, 670, __pyx_L1_error))
8024  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
8025  __Pyx_GOTREF(__pyx_t_1);
8026  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
8027  __Pyx_GOTREF(__pyx_t_2);
8028  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8029  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error)
8030  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8031  __pyx_v_A_num_rows = __pyx_t_3;
8032 
8033  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":671
8034  * # Matrix size
8035  * cdef LongIndexType A_num_rows = A.shape[0]
8036  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
8037  *
8038  * # If the input type is the same as LongIndexType, no copy is performed.
8039  */
8040  __Pyx_TraceLine(671,0,__PYX_ERR(0, 671, __pyx_L1_error))
8041  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
8042  __Pyx_GOTREF(__pyx_t_2);
8043  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
8044  __Pyx_GOTREF(__pyx_t_1);
8045  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8046  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L1_error)
8047  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8048  __pyx_v_A_num_columns = __pyx_t_3;
8049 
8050  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":675
8051  * # If the input type is the same as LongIndexType, no copy is performed.
8052  * self.A_indices_copy = \
8053  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8054  * self.A_index_pointer_copy = \
8055  * A.indptr.astype(self.long_index_type_name, copy=False)
8056  */
8057  __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L1_error))
8058  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
8059  __Pyx_GOTREF(__pyx_t_1);
8060  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
8061  __Pyx_GOTREF(__pyx_t_2);
8062  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8063  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
8064  __Pyx_GOTREF(__pyx_t_1);
8065  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
8066  __Pyx_GOTREF(__pyx_t_4);
8067  __Pyx_GIVEREF(__pyx_t_1);
8068  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8069  __pyx_t_1 = 0;
8070  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
8071  __Pyx_GOTREF(__pyx_t_1);
8072  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
8073  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error)
8074  __Pyx_GOTREF(__pyx_t_5);
8075  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8076  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8077  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8078 
8079  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":674
8080  *
8081  * # If the input type is the same as LongIndexType, no copy is performed.
8082  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
8083  * A.indices.astype(self.long_index_type_name, copy=False)
8084  * self.A_index_pointer_copy = \
8085  */
8086  __Pyx_TraceLine(674,0,__PYX_ERR(0, 674, __pyx_L1_error))
8087  __Pyx_GIVEREF(__pyx_t_5);
8088  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
8089  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
8090  __pyx_v_self->A_indices_copy = __pyx_t_5;
8091  __pyx_t_5 = 0;
8092 
8093  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":677
8094  * A.indices.astype(self.long_index_type_name, copy=False)
8095  * self.A_index_pointer_copy = \
8096  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8097  *
8098  * # Declare memoryviews to get pointers
8099  */
8100  __Pyx_TraceLine(677,0,__PYX_ERR(0, 677, __pyx_L1_error))
8101  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
8102  __Pyx_GOTREF(__pyx_t_5);
8103  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
8104  __Pyx_GOTREF(__pyx_t_1);
8105  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8106  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
8107  __Pyx_GOTREF(__pyx_t_5);
8108  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
8109  __Pyx_GOTREF(__pyx_t_4);
8110  __Pyx_GIVEREF(__pyx_t_5);
8111  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8112  __pyx_t_5 = 0;
8113  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
8114  __Pyx_GOTREF(__pyx_t_5);
8115  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 677, __pyx_L1_error)
8116  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
8117  __Pyx_GOTREF(__pyx_t_2);
8118  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8119  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8120  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8121 
8122  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":676
8123  * self.A_indices_copy = \
8124  * A.indices.astype(self.long_index_type_name, copy=False)
8125  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
8126  * A.indptr.astype(self.long_index_type_name, copy=False)
8127  *
8128  */
8129  __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L1_error))
8130  __Pyx_GIVEREF(__pyx_t_2);
8131  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
8132  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
8133  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
8134  __pyx_t_2 = 0;
8135 
8136  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":680
8137  *
8138  * # Declare memoryviews to get pointers
8139  * cdef double[:] A_data_mv = A.data # <<<<<<<<<<<<<<
8140  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
8141  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8142  */
8143  __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error))
8144  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
8145  __Pyx_GOTREF(__pyx_t_2);
8146  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 680, __pyx_L1_error)
8147  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8148  __pyx_v_A_data_mv = __pyx_t_6;
8149  __pyx_t_6.memview = NULL;
8150  __pyx_t_6.data = NULL;
8151 
8152  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":681
8153  * # Declare memoryviews to get pointers
8154  * cdef double[:] A_data_mv = A.data
8155  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
8156  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8157  * self.A_index_pointer_copy
8158  */
8159  __Pyx_TraceLine(681,0,__PYX_ERR(0, 681, __pyx_L1_error))
8160  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 681, __pyx_L1_error)
8161  __pyx_v_A_indices_mv = __pyx_t_7;
8162  __pyx_t_7.memview = NULL;
8163  __pyx_t_7.data = NULL;
8164 
8165  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":683
8166  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
8167  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8168  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
8169  * cdef double[:] B_data_mv = None
8170  * cdef MemoryViewLongIndexType B_indices_mv = None
8171  */
8172  __Pyx_TraceLine(683,0,__PYX_ERR(0, 683, __pyx_L1_error))
8173  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 683, __pyx_L1_error)
8174  __pyx_v_A_index_pointer_mv = __pyx_t_7;
8175  __pyx_t_7.memview = NULL;
8176  __pyx_t_7.data = NULL;
8177 
8178  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":684
8179  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8180  * self.A_index_pointer_copy
8181  * cdef double[:] B_data_mv = None # <<<<<<<<<<<<<<
8182  * cdef MemoryViewLongIndexType B_indices_mv = None
8183  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8184  */
8185  __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L1_error))
8186  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 684, __pyx_L1_error)
8187  __pyx_v_B_data_mv = __pyx_t_6;
8188  __pyx_t_6.memview = NULL;
8189  __pyx_t_6.data = NULL;
8190 
8191  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":685
8192  * self.A_index_pointer_copy
8193  * cdef double[:] B_data_mv = None
8194  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
8195  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8196  *
8197  */
8198  __Pyx_TraceLine(685,0,__PYX_ERR(0, 685, __pyx_L1_error))
8199  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 685, __pyx_L1_error)
8200  __pyx_v_B_indices_mv = __pyx_t_7;
8201  __pyx_t_7.memview = NULL;
8202  __pyx_t_7.data = NULL;
8203 
8204  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":686
8205  * cdef double[:] B_data_mv = None
8206  * cdef MemoryViewLongIndexType B_indices_mv = None
8207  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
8208  *
8209  * if not B_is_identity:
8210  */
8211  __Pyx_TraceLine(686,0,__PYX_ERR(0, 686, __pyx_L1_error))
8212  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
8213  __pyx_v_B_index_pointer_mv = __pyx_t_7;
8214  __pyx_t_7.memview = NULL;
8215  __pyx_t_7.data = NULL;
8216 
8217  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":688
8218  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8219  *
8220  * if not B_is_identity: # <<<<<<<<<<<<<<
8221  *
8222  * # If input type is the same as LongIndexType, no copy is performed.
8223  */
8224  __Pyx_TraceLine(688,0,__PYX_ERR(0, 688, __pyx_L1_error))
8225  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 688, __pyx_L1_error)
8226  __pyx_t_9 = ((!__pyx_t_8) != 0);
8227  if (__pyx_t_9) {
8228 
8229  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":692
8230  * # If input type is the same as LongIndexType, no copy is performed.
8231  * self.B_indices_copy = \
8232  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8233  * self.B_index_pointer_copy = \
8234  * B.indptr.astype(self.long_index_type_name, copy=False)
8235  */
8236  __Pyx_TraceLine(692,0,__PYX_ERR(0, 692, __pyx_L1_error))
8237  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8238  __Pyx_GOTREF(__pyx_t_2);
8239  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
8240  __Pyx_GOTREF(__pyx_t_5);
8241  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8242  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8243  __Pyx_GOTREF(__pyx_t_2);
8244  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
8245  __Pyx_GOTREF(__pyx_t_4);
8246  __Pyx_GIVEREF(__pyx_t_2);
8247  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
8248  __pyx_t_2 = 0;
8249  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8250  __Pyx_GOTREF(__pyx_t_2);
8251  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
8252  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
8253  __Pyx_GOTREF(__pyx_t_1);
8254  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8255  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8256  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8257 
8258  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":691
8259  *
8260  * # If input type is the same as LongIndexType, no copy is performed.
8261  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
8262  * B.indices.astype(self.long_index_type_name, copy=False)
8263  * self.B_index_pointer_copy = \
8264  */
8265  __Pyx_TraceLine(691,0,__PYX_ERR(0, 691, __pyx_L1_error))
8266  __Pyx_GIVEREF(__pyx_t_1);
8267  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
8268  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
8269  __pyx_v_self->B_indices_copy = __pyx_t_1;
8270  __pyx_t_1 = 0;
8271 
8272  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":694
8273  * B.indices.astype(self.long_index_type_name, copy=False)
8274  * self.B_index_pointer_copy = \
8275  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8276  *
8277  * B_data_mv = B.data
8278  */
8279  __Pyx_TraceLine(694,0,__PYX_ERR(0, 694, __pyx_L1_error))
8280  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8281  __Pyx_GOTREF(__pyx_t_1);
8282  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
8283  __Pyx_GOTREF(__pyx_t_2);
8284  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8285  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8286  __Pyx_GOTREF(__pyx_t_1);
8287  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
8288  __Pyx_GOTREF(__pyx_t_4);
8289  __Pyx_GIVEREF(__pyx_t_1);
8290  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8291  __pyx_t_1 = 0;
8292  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8293  __Pyx_GOTREF(__pyx_t_1);
8294  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 694, __pyx_L1_error)
8295  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
8296  __Pyx_GOTREF(__pyx_t_5);
8297  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8298  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8299  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8300 
8301  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":693
8302  * self.B_indices_copy = \
8303  * B.indices.astype(self.long_index_type_name, copy=False)
8304  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
8305  * B.indptr.astype(self.long_index_type_name, copy=False)
8306  *
8307  */
8308  __Pyx_TraceLine(693,0,__PYX_ERR(0, 693, __pyx_L1_error))
8309  __Pyx_GIVEREF(__pyx_t_5);
8310  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
8311  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
8312  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
8313  __pyx_t_5 = 0;
8314 
8315  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":696
8316  * B.indptr.astype(self.long_index_type_name, copy=False)
8317  *
8318  * B_data_mv = B.data # <<<<<<<<<<<<<<
8319  * B_indices_mv = self.B_indices_copy
8320  * B_index_pointer_mv = self.B_index_pointer_copy
8321  */
8322  __Pyx_TraceLine(696,0,__PYX_ERR(0, 696, __pyx_L1_error))
8323  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
8324  __Pyx_GOTREF(__pyx_t_5);
8325  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 696, __pyx_L1_error)
8326  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8327  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8328  __pyx_v_B_data_mv = __pyx_t_6;
8329  __pyx_t_6.memview = NULL;
8330  __pyx_t_6.data = NULL;
8331 
8332  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":697
8333  *
8334  * B_data_mv = B.data
8335  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
8336  * B_index_pointer_mv = self.B_index_pointer_copy
8337  *
8338  */
8339  __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L1_error))
8340  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 697, __pyx_L1_error)
8341  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8342  __pyx_v_B_indices_mv = __pyx_t_7;
8343  __pyx_t_7.memview = NULL;
8344  __pyx_t_7.data = NULL;
8345 
8346  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":698
8347  * B_data_mv = B.data
8348  * B_indices_mv = self.B_indices_copy
8349  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
8350  *
8351  * # Declare pointers
8352  */
8353  __Pyx_TraceLine(698,0,__PYX_ERR(0, 698, __pyx_L1_error))
8354  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 698, __pyx_L1_error)
8355  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8356  __pyx_v_B_index_pointer_mv = __pyx_t_7;
8357  __pyx_t_7.memview = NULL;
8358  __pyx_t_7.data = NULL;
8359 
8360  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":688
8361  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8362  *
8363  * if not B_is_identity: # <<<<<<<<<<<<<<
8364  *
8365  * # If input type is the same as LongIndexType, no copy is performed.
8366  */
8367  }
8368 
8369  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":701
8370  *
8371  * # Declare pointers
8372  * cdef double* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
8373  * cdef LongIndexType* A_indices = &A_indices_mv[0]
8374  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8375  */
8376  __Pyx_TraceLine(701,0,__PYX_ERR(0, 701, __pyx_L1_error))
8377  __pyx_t_10 = 0;
8378  __pyx_v_A_data = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
8379 
8380  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":702
8381  * # Declare pointers
8382  * cdef double* A_data = &A_data_mv[0]
8383  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
8384  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8385  * cdef double* B_data = NULL
8386  */
8387  __Pyx_TraceLine(702,0,__PYX_ERR(0, 702, __pyx_L1_error))
8388  __pyx_t_10 = 0;
8389  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
8390 
8391  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":703
8392  * cdef double* A_data = &A_data_mv[0]
8393  * cdef LongIndexType* A_indices = &A_indices_mv[0]
8394  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
8395  * cdef double* B_data = NULL
8396  * cdef LongIndexType* B_indices = NULL
8397  */
8398  __Pyx_TraceLine(703,0,__PYX_ERR(0, 703, __pyx_L1_error))
8399  __pyx_t_10 = 0;
8400  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
8401 
8402  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":704
8403  * cdef LongIndexType* A_indices = &A_indices_mv[0]
8404  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8405  * cdef double* B_data = NULL # <<<<<<<<<<<<<<
8406  * cdef LongIndexType* B_indices = NULL
8407  * cdef LongIndexType* B_index_pointer = NULL
8408  */
8409  __Pyx_TraceLine(704,0,__PYX_ERR(0, 704, __pyx_L1_error))
8410  __pyx_v_B_data = NULL;
8411 
8412  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":705
8413  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8414  * cdef double* B_data = NULL
8415  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
8416  * cdef LongIndexType* B_index_pointer = NULL
8417  *
8418  */
8419  __Pyx_TraceLine(705,0,__PYX_ERR(0, 705, __pyx_L1_error))
8420  __pyx_v_B_indices = NULL;
8421 
8422  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":706
8423  * cdef double* B_data = NULL
8424  * cdef LongIndexType* B_indices = NULL
8425  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
8426  *
8427  * if not B_is_identity:
8428  */
8429  __Pyx_TraceLine(706,0,__PYX_ERR(0, 706, __pyx_L1_error))
8430  __pyx_v_B_index_pointer = NULL;
8431 
8432  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":708
8433  * cdef LongIndexType* B_index_pointer = NULL
8434  *
8435  * if not B_is_identity: # <<<<<<<<<<<<<<
8436  * B_data = &B_data_mv[0]
8437  * B_indices = &B_indices_mv[0]
8438  */
8439  __Pyx_TraceLine(708,0,__PYX_ERR(0, 708, __pyx_L1_error))
8440  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 708, __pyx_L1_error)
8441  __pyx_t_8 = ((!__pyx_t_9) != 0);
8442  if (__pyx_t_8) {
8443 
8444  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":709
8445  *
8446  * if not B_is_identity:
8447  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
8448  * B_indices = &B_indices_mv[0]
8449  * B_index_pointer = &B_index_pointer_mv[0]
8450  */
8451  __Pyx_TraceLine(709,0,__PYX_ERR(0, 709, __pyx_L1_error))
8452  __pyx_t_10 = 0;
8453  __pyx_v_B_data = (&(*((double *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
8454 
8455  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":710
8456  * if not B_is_identity:
8457  * B_data = &B_data_mv[0]
8458  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
8459  * B_index_pointer = &B_index_pointer_mv[0]
8460  *
8461  */
8462  __Pyx_TraceLine(710,0,__PYX_ERR(0, 710, __pyx_L1_error))
8463  __pyx_t_10 = 0;
8464  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
8465 
8466  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":711
8467  * B_data = &B_data_mv[0]
8468  * B_indices = &B_indices_mv[0]
8469  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
8470  *
8471  * # Create a linear operator object
8472  */
8473  __Pyx_TraceLine(711,0,__PYX_ERR(0, 711, __pyx_L1_error))
8474  __pyx_t_10 = 0;
8475  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
8476 
8477  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":708
8478  * cdef LongIndexType* B_index_pointer = NULL
8479  *
8480  * if not B_is_identity: # <<<<<<<<<<<<<<
8481  * B_data = &B_data_mv[0]
8482  * B_indices = &B_indices_mv[0]
8483  */
8484  }
8485 
8486  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":714
8487  *
8488  * # Create a linear operator object
8489  * if B_is_identity: # <<<<<<<<<<<<<<
8490  * self.Aop_double = new cCSRAffineMatrixFunction[double](
8491  * A_data,
8492  */
8493  __Pyx_TraceLine(714,0,__PYX_ERR(0, 714, __pyx_L1_error))
8494  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
8495  if (__pyx_t_8) {
8496 
8497  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":715
8498  * # Create a linear operator object
8499  * if B_is_identity:
8500  * self.Aop_double = new cCSRAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
8501  * A_data,
8502  * A_indices,
8503  */
8504  __Pyx_TraceLine(715,0,__PYX_ERR(0, 715, __pyx_L1_error))
8505  try {
8506  __pyx_t_11 = new cCSRAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
8507  } catch(...) {
8508  __Pyx_CppExn2PyErr();
8509  __PYX_ERR(0, 715, __pyx_L1_error)
8510  }
8511  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
8512 
8513  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":714
8514  *
8515  * # Create a linear operator object
8516  * if B_is_identity: # <<<<<<<<<<<<<<
8517  * self.Aop_double = new cCSRAffineMatrixFunction[double](
8518  * A_data,
8519  */
8520  goto __pyx_L5;
8521  }
8522 
8523  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":722
8524  * A_num_columns)
8525  * else:
8526  * self.Aop_double = new cCSRAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
8527  * A_data,
8528  * A_indices,
8529  */
8530  __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
8531  /*else*/ {
8532 
8533  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":730
8534  * B_data,
8535  * B_indices,
8536  * B_index_pointer) # <<<<<<<<<<<<<<
8537  *
8538  * # ==========================
8539  */
8540  __Pyx_TraceLine(730,0,__PYX_ERR(0, 730, __pyx_L1_error))
8541  try {
8542  __pyx_t_11 = new cCSRAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
8543  } catch(...) {
8544  __Pyx_CppExn2PyErr();
8545  __PYX_ERR(0, 722, __pyx_L1_error)
8546  }
8547 
8548  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":722
8549  * A_num_columns)
8550  * else:
8551  * self.Aop_double = new cCSRAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
8552  * A_data,
8553  * A_indices,
8554  */
8555  __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
8556  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
8557  }
8558  __pyx_L5:;
8559 
8560  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":665
8561  * # =====================
8562  *
8563  * def set_csr_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
8564  * """
8565  * """
8566  */
8567 
8568  /* function exit code */
8569  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8570  goto __pyx_L0;
8571  __pyx_L1_error:;
8572  __Pyx_XDECREF(__pyx_t_1);
8573  __Pyx_XDECREF(__pyx_t_2);
8574  __Pyx_XDECREF(__pyx_t_4);
8575  __Pyx_XDECREF(__pyx_t_5);
8576  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
8577  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
8578  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8579  __pyx_r = NULL;
8580  __pyx_L0:;
8581  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
8582  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
8583  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
8584  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8585  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8586  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8587  __Pyx_XGIVEREF(__pyx_r);
8588  __Pyx_TraceReturn(__pyx_r, 0);
8589  __Pyx_RefNannyFinishContext();
8590  return __pyx_r;
8591 }
8592 
8593 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":736
8594  * # ==========================
8595  *
8596  * def set_csr_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
8597  * """
8598  * """
8599  */
8600 
8601 /* Python wrapper */
8602 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8603 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double[] = "pycAffineMatrixFunction.set_csr_matrix_long_double(self, A, B, B_is_identity)\n\n ";
8604 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double = {"set_csr_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double};
8605 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8606  PyObject *__pyx_v_A = 0;
8607  PyObject *__pyx_v_B = 0;
8608  PyObject *__pyx_v_B_is_identity = 0;
8609  int __pyx_lineno = 0;
8610  const char *__pyx_filename = NULL;
8611  int __pyx_clineno = 0;
8612  PyObject *__pyx_r = 0;
8613  __Pyx_RefNannyDeclarations
8614  __Pyx_RefNannySetupContext("set_csr_matrix_long_double (wrapper)", 0);
8615  {
8616  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
8617  PyObject* values[3] = {0,0,0};
8618  if (unlikely(__pyx_kwds)) {
8619  Py_ssize_t kw_args;
8620  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8621  switch (pos_args) {
8622  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8623  CYTHON_FALLTHROUGH;
8624  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8625  CYTHON_FALLTHROUGH;
8626  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8627  CYTHON_FALLTHROUGH;
8628  case 0: break;
8629  default: goto __pyx_L5_argtuple_error;
8630  }
8631  kw_args = PyDict_Size(__pyx_kwds);
8632  switch (pos_args) {
8633  case 0:
8634  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
8635  else goto __pyx_L5_argtuple_error;
8636  CYTHON_FALLTHROUGH;
8637  case 1:
8638  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
8639  else {
8640  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 736, __pyx_L3_error)
8641  }
8642  CYTHON_FALLTHROUGH;
8643  case 2:
8644  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
8645  else {
8646  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 736, __pyx_L3_error)
8647  }
8648  }
8649  if (unlikely(kw_args > 0)) {
8650  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csr_matrix_long_double") < 0)) __PYX_ERR(0, 736, __pyx_L3_error)
8651  }
8652  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
8653  goto __pyx_L5_argtuple_error;
8654  } else {
8655  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8656  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8657  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8658  }
8659  __pyx_v_A = values[0];
8660  __pyx_v_B = values[1];
8661  __pyx_v_B_is_identity = values[2];
8662  }
8663  goto __pyx_L4_argument_unpacking_done;
8664  __pyx_L5_argtuple_error:;
8665  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 736, __pyx_L3_error)
8666  __pyx_L3_error:;
8667  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8668  __Pyx_RefNannyFinishContext();
8669  return NULL;
8670  __pyx_L4_argument_unpacking_done:;
8671  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
8672 
8673  /* function exit code */
8674  __Pyx_RefNannyFinishContext();
8675  return __pyx_r;
8676 }
8677 
8678 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
8679  LongIndexType __pyx_v_A_num_rows;
8680  LongIndexType __pyx_v_A_num_columns;
8681  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8682  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8683  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8684  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8685  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8686  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8687  long double *__pyx_v_A_data;
8688  LongIndexType *__pyx_v_A_indices;
8689  LongIndexType *__pyx_v_A_index_pointer;
8690  long double *__pyx_v_B_data;
8691  LongIndexType *__pyx_v_B_indices;
8692  LongIndexType *__pyx_v_B_index_pointer;
8693  PyObject *__pyx_r = NULL;
8694  __Pyx_TraceDeclarations
8695  __Pyx_RefNannyDeclarations
8696  PyObject *__pyx_t_1 = NULL;
8697  PyObject *__pyx_t_2 = NULL;
8698  LongIndexType __pyx_t_3;
8699  PyObject *__pyx_t_4 = NULL;
8700  PyObject *__pyx_t_5 = NULL;
8701  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
8702  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
8703  int __pyx_t_8;
8704  int __pyx_t_9;
8705  Py_ssize_t __pyx_t_10;
8707  int __pyx_lineno = 0;
8708  const char *__pyx_filename = NULL;
8709  int __pyx_clineno = 0;
8710  __Pyx_TraceFrameInit(__pyx_codeobj__14)
8711  __Pyx_RefNannySetupContext("set_csr_matrix_long_double", 0);
8712  __Pyx_TraceCall("set_csr_matrix_long_double", __pyx_f[0], 736, 0, __PYX_ERR(0, 736, __pyx_L1_error));
8713 
8714  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":741
8715  *
8716  * # Matrix size
8717  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
8718  * cdef LongIndexType A_num_columns = A.shape[1]
8719  *
8720  */
8721  __Pyx_TraceLine(741,0,__PYX_ERR(0, 741, __pyx_L1_error))
8722  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
8723  __Pyx_GOTREF(__pyx_t_1);
8724  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
8725  __Pyx_GOTREF(__pyx_t_2);
8726  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8727  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 741, __pyx_L1_error)
8728  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8729  __pyx_v_A_num_rows = __pyx_t_3;
8730 
8731  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":742
8732  * # Matrix size
8733  * cdef LongIndexType A_num_rows = A.shape[0]
8734  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
8735  *
8736  * # If the input type is the same as LongIndexType, no copy is performed.
8737  */
8738  __Pyx_TraceLine(742,0,__PYX_ERR(0, 742, __pyx_L1_error))
8739  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
8740  __Pyx_GOTREF(__pyx_t_2);
8741  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
8742  __Pyx_GOTREF(__pyx_t_1);
8743  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8744  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 742, __pyx_L1_error)
8745  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8746  __pyx_v_A_num_columns = __pyx_t_3;
8747 
8748  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":746
8749  * # If the input type is the same as LongIndexType, no copy is performed.
8750  * self.A_indices_copy = \
8751  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8752  * self.A_index_pointer_copy = \
8753  * A.indptr.astype(self.long_index_type_name, copy=False)
8754  */
8755  __Pyx_TraceLine(746,0,__PYX_ERR(0, 746, __pyx_L1_error))
8756  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8757  __Pyx_GOTREF(__pyx_t_1);
8758  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
8759  __Pyx_GOTREF(__pyx_t_2);
8760  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8761  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8762  __Pyx_GOTREF(__pyx_t_1);
8763  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error)
8764  __Pyx_GOTREF(__pyx_t_4);
8765  __Pyx_GIVEREF(__pyx_t_1);
8766  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8767  __pyx_t_1 = 0;
8768  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8769  __Pyx_GOTREF(__pyx_t_1);
8770  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
8771  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
8772  __Pyx_GOTREF(__pyx_t_5);
8773  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8774  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8775  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8776 
8777  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":745
8778  *
8779  * # If the input type is the same as LongIndexType, no copy is performed.
8780  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
8781  * A.indices.astype(self.long_index_type_name, copy=False)
8782  * self.A_index_pointer_copy = \
8783  */
8784  __Pyx_TraceLine(745,0,__PYX_ERR(0, 745, __pyx_L1_error))
8785  __Pyx_GIVEREF(__pyx_t_5);
8786  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
8787  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
8788  __pyx_v_self->A_indices_copy = __pyx_t_5;
8789  __pyx_t_5 = 0;
8790 
8791  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":748
8792  * A.indices.astype(self.long_index_type_name, copy=False)
8793  * self.A_index_pointer_copy = \
8794  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8795  *
8796  * # Declare memoryviews to get pointers
8797  */
8798  __Pyx_TraceLine(748,0,__PYX_ERR(0, 748, __pyx_L1_error))
8799  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8800  __Pyx_GOTREF(__pyx_t_5);
8801  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8802  __Pyx_GOTREF(__pyx_t_1);
8803  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8804  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8805  __Pyx_GOTREF(__pyx_t_5);
8806  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error)
8807  __Pyx_GOTREF(__pyx_t_4);
8808  __Pyx_GIVEREF(__pyx_t_5);
8809  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8810  __pyx_t_5 = 0;
8811  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8812  __Pyx_GOTREF(__pyx_t_5);
8813  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
8814  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
8815  __Pyx_GOTREF(__pyx_t_2);
8816  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8817  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8818  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8819 
8820  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":747
8821  * self.A_indices_copy = \
8822  * A.indices.astype(self.long_index_type_name, copy=False)
8823  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
8824  * A.indptr.astype(self.long_index_type_name, copy=False)
8825  *
8826  */
8827  __Pyx_TraceLine(747,0,__PYX_ERR(0, 747, __pyx_L1_error))
8828  __Pyx_GIVEREF(__pyx_t_2);
8829  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
8830  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
8831  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
8832  __pyx_t_2 = 0;
8833 
8834  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":751
8835  *
8836  * # Declare memoryviews to get pointers
8837  * cdef long double[:] A_data_mv = A.data # <<<<<<<<<<<<<<
8838  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
8839  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8840  */
8841  __Pyx_TraceLine(751,0,__PYX_ERR(0, 751, __pyx_L1_error))
8842  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
8843  __Pyx_GOTREF(__pyx_t_2);
8844  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 751, __pyx_L1_error)
8845  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8846  __pyx_v_A_data_mv = __pyx_t_6;
8847  __pyx_t_6.memview = NULL;
8848  __pyx_t_6.data = NULL;
8849 
8850  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":752
8851  * # Declare memoryviews to get pointers
8852  * cdef long double[:] A_data_mv = A.data
8853  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
8854  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8855  * self.A_index_pointer_copy
8856  */
8857  __Pyx_TraceLine(752,0,__PYX_ERR(0, 752, __pyx_L1_error))
8858  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 752, __pyx_L1_error)
8859  __pyx_v_A_indices_mv = __pyx_t_7;
8860  __pyx_t_7.memview = NULL;
8861  __pyx_t_7.data = NULL;
8862 
8863  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":754
8864  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
8865  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8866  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
8867  * cdef long double[:] B_data_mv = None
8868  * cdef MemoryViewLongIndexType B_indices_mv = None
8869  */
8870  __Pyx_TraceLine(754,0,__PYX_ERR(0, 754, __pyx_L1_error))
8871  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 754, __pyx_L1_error)
8872  __pyx_v_A_index_pointer_mv = __pyx_t_7;
8873  __pyx_t_7.memview = NULL;
8874  __pyx_t_7.data = NULL;
8875 
8876  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":755
8877  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8878  * self.A_index_pointer_copy
8879  * cdef long double[:] B_data_mv = None # <<<<<<<<<<<<<<
8880  * cdef MemoryViewLongIndexType B_indices_mv = None
8881  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8882  */
8883  __Pyx_TraceLine(755,0,__PYX_ERR(0, 755, __pyx_L1_error))
8884  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 755, __pyx_L1_error)
8885  __pyx_v_B_data_mv = __pyx_t_6;
8886  __pyx_t_6.memview = NULL;
8887  __pyx_t_6.data = NULL;
8888 
8889  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":756
8890  * self.A_index_pointer_copy
8891  * cdef long double[:] B_data_mv = None
8892  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
8893  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8894  *
8895  */
8896  __Pyx_TraceLine(756,0,__PYX_ERR(0, 756, __pyx_L1_error))
8897  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 756, __pyx_L1_error)
8898  __pyx_v_B_indices_mv = __pyx_t_7;
8899  __pyx_t_7.memview = NULL;
8900  __pyx_t_7.data = NULL;
8901 
8902  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":757
8903  * cdef long double[:] B_data_mv = None
8904  * cdef MemoryViewLongIndexType B_indices_mv = None
8905  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
8906  *
8907  * if not B_is_identity:
8908  */
8909  __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L1_error))
8910  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 757, __pyx_L1_error)
8911  __pyx_v_B_index_pointer_mv = __pyx_t_7;
8912  __pyx_t_7.memview = NULL;
8913  __pyx_t_7.data = NULL;
8914 
8915  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":759
8916  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8917  *
8918  * if not B_is_identity: # <<<<<<<<<<<<<<
8919  *
8920  * # If input type is the same as LongIndexType, no copy is performed.
8921  */
8922  __Pyx_TraceLine(759,0,__PYX_ERR(0, 759, __pyx_L1_error))
8923  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 759, __pyx_L1_error)
8924  __pyx_t_9 = ((!__pyx_t_8) != 0);
8925  if (__pyx_t_9) {
8926 
8927  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":763
8928  * # If input type is the same as LongIndexType, no copy is performed.
8929  * self.B_indices_copy = \
8930  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8931  * self.B_index_pointer_copy = \
8932  * B.indptr.astype(self.long_index_type_name, copy=False)
8933  */
8934  __Pyx_TraceLine(763,0,__PYX_ERR(0, 763, __pyx_L1_error))
8935  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8936  __Pyx_GOTREF(__pyx_t_2);
8937  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
8938  __Pyx_GOTREF(__pyx_t_5);
8939  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8940  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8941  __Pyx_GOTREF(__pyx_t_2);
8942  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
8943  __Pyx_GOTREF(__pyx_t_4);
8944  __Pyx_GIVEREF(__pyx_t_2);
8945  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
8946  __pyx_t_2 = 0;
8947  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8948  __Pyx_GOTREF(__pyx_t_2);
8949  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 763, __pyx_L1_error)
8950  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
8951  __Pyx_GOTREF(__pyx_t_1);
8952  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8953  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8954  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8955 
8956  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":762
8957  *
8958  * # If input type is the same as LongIndexType, no copy is performed.
8959  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
8960  * B.indices.astype(self.long_index_type_name, copy=False)
8961  * self.B_index_pointer_copy = \
8962  */
8963  __Pyx_TraceLine(762,0,__PYX_ERR(0, 762, __pyx_L1_error))
8964  __Pyx_GIVEREF(__pyx_t_1);
8965  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
8966  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
8967  __pyx_v_self->B_indices_copy = __pyx_t_1;
8968  __pyx_t_1 = 0;
8969 
8970  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":765
8971  * B.indices.astype(self.long_index_type_name, copy=False)
8972  * self.B_index_pointer_copy = \
8973  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8974  *
8975  * B_data_mv = B.data
8976  */
8977  __Pyx_TraceLine(765,0,__PYX_ERR(0, 765, __pyx_L1_error))
8978  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8979  __Pyx_GOTREF(__pyx_t_1);
8980  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
8981  __Pyx_GOTREF(__pyx_t_2);
8982  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8983  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8984  __Pyx_GOTREF(__pyx_t_1);
8985  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
8986  __Pyx_GOTREF(__pyx_t_4);
8987  __Pyx_GIVEREF(__pyx_t_1);
8988  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8989  __pyx_t_1 = 0;
8990  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8991  __Pyx_GOTREF(__pyx_t_1);
8992  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
8993  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 765, __pyx_L1_error)
8994  __Pyx_GOTREF(__pyx_t_5);
8995  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8996  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8997  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8998 
8999  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":764
9000  * self.B_indices_copy = \
9001  * B.indices.astype(self.long_index_type_name, copy=False)
9002  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
9003  * B.indptr.astype(self.long_index_type_name, copy=False)
9004  *
9005  */
9006  __Pyx_TraceLine(764,0,__PYX_ERR(0, 764, __pyx_L1_error))
9007  __Pyx_GIVEREF(__pyx_t_5);
9008  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
9009  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
9010  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
9011  __pyx_t_5 = 0;
9012 
9013  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":767
9014  * B.indptr.astype(self.long_index_type_name, copy=False)
9015  *
9016  * B_data_mv = B.data # <<<<<<<<<<<<<<
9017  * B_indices_mv = self.B_indices_copy
9018  * B_index_pointer_mv = self.B_index_pointer_copy
9019  */
9020  __Pyx_TraceLine(767,0,__PYX_ERR(0, 767, __pyx_L1_error))
9021  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
9022  __Pyx_GOTREF(__pyx_t_5);
9023  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 767, __pyx_L1_error)
9024  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9025  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9026  __pyx_v_B_data_mv = __pyx_t_6;
9027  __pyx_t_6.memview = NULL;
9028  __pyx_t_6.data = NULL;
9029 
9030  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":768
9031  *
9032  * B_data_mv = B.data
9033  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
9034  * B_index_pointer_mv = self.B_index_pointer_copy
9035  *
9036  */
9037  __Pyx_TraceLine(768,0,__PYX_ERR(0, 768, __pyx_L1_error))
9038  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 768, __pyx_L1_error)
9039  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9040  __pyx_v_B_indices_mv = __pyx_t_7;
9041  __pyx_t_7.memview = NULL;
9042  __pyx_t_7.data = NULL;
9043 
9044  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":769
9045  * B_data_mv = B.data
9046  * B_indices_mv = self.B_indices_copy
9047  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
9048  *
9049  * # Declare pointers
9050  */
9051  __Pyx_TraceLine(769,0,__PYX_ERR(0, 769, __pyx_L1_error))
9052  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 769, __pyx_L1_error)
9053  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9054  __pyx_v_B_index_pointer_mv = __pyx_t_7;
9055  __pyx_t_7.memview = NULL;
9056  __pyx_t_7.data = NULL;
9057 
9058  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":759
9059  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
9060  *
9061  * if not B_is_identity: # <<<<<<<<<<<<<<
9062  *
9063  * # If input type is the same as LongIndexType, no copy is performed.
9064  */
9065  }
9066 
9067  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":772
9068  *
9069  * # Declare pointers
9070  * cdef long double* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
9071  * cdef LongIndexType* A_indices = &A_indices_mv[0]
9072  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9073  */
9074  __Pyx_TraceLine(772,0,__PYX_ERR(0, 772, __pyx_L1_error))
9075  __pyx_t_10 = 0;
9076  __pyx_v_A_data = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
9077 
9078  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":773
9079  * # Declare pointers
9080  * cdef long double* A_data = &A_data_mv[0]
9081  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
9082  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9083  * cdef long double* B_data = NULL
9084  */
9085  __Pyx_TraceLine(773,0,__PYX_ERR(0, 773, __pyx_L1_error))
9086  __pyx_t_10 = 0;
9087  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
9088 
9089  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":774
9090  * cdef long double* A_data = &A_data_mv[0]
9091  * cdef LongIndexType* A_indices = &A_indices_mv[0]
9092  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
9093  * cdef long double* B_data = NULL
9094  * cdef LongIndexType* B_indices = NULL
9095  */
9096  __Pyx_TraceLine(774,0,__PYX_ERR(0, 774, __pyx_L1_error))
9097  __pyx_t_10 = 0;
9098  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
9099 
9100  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":775
9101  * cdef LongIndexType* A_indices = &A_indices_mv[0]
9102  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9103  * cdef long double* B_data = NULL # <<<<<<<<<<<<<<
9104  * cdef LongIndexType* B_indices = NULL
9105  * cdef LongIndexType* B_index_pointer = NULL
9106  */
9107  __Pyx_TraceLine(775,0,__PYX_ERR(0, 775, __pyx_L1_error))
9108  __pyx_v_B_data = NULL;
9109 
9110  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":776
9111  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9112  * cdef long double* B_data = NULL
9113  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
9114  * cdef LongIndexType* B_index_pointer = NULL
9115  *
9116  */
9117  __Pyx_TraceLine(776,0,__PYX_ERR(0, 776, __pyx_L1_error))
9118  __pyx_v_B_indices = NULL;
9119 
9120  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":777
9121  * cdef long double* B_data = NULL
9122  * cdef LongIndexType* B_indices = NULL
9123  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
9124  *
9125  * if not B_is_identity:
9126  */
9127  __Pyx_TraceLine(777,0,__PYX_ERR(0, 777, __pyx_L1_error))
9128  __pyx_v_B_index_pointer = NULL;
9129 
9130  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":779
9131  * cdef LongIndexType* B_index_pointer = NULL
9132  *
9133  * if not B_is_identity: # <<<<<<<<<<<<<<
9134  * B_data = &B_data_mv[0]
9135  * B_indices = &B_indices_mv[0]
9136  */
9137  __Pyx_TraceLine(779,0,__PYX_ERR(0, 779, __pyx_L1_error))
9138  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 779, __pyx_L1_error)
9139  __pyx_t_8 = ((!__pyx_t_9) != 0);
9140  if (__pyx_t_8) {
9141 
9142  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":780
9143  *
9144  * if not B_is_identity:
9145  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
9146  * B_indices = &B_indices_mv[0]
9147  * B_index_pointer = &B_index_pointer_mv[0]
9148  */
9149  __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L1_error))
9150  __pyx_t_10 = 0;
9151  __pyx_v_B_data = (&(*((long double *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
9152 
9153  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":781
9154  * if not B_is_identity:
9155  * B_data = &B_data_mv[0]
9156  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
9157  * B_index_pointer = &B_index_pointer_mv[0]
9158  *
9159  */
9160  __Pyx_TraceLine(781,0,__PYX_ERR(0, 781, __pyx_L1_error))
9161  __pyx_t_10 = 0;
9162  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
9163 
9164  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":782
9165  * B_data = &B_data_mv[0]
9166  * B_indices = &B_indices_mv[0]
9167  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
9168  *
9169  * # Create a linear operator object
9170  */
9171  __Pyx_TraceLine(782,0,__PYX_ERR(0, 782, __pyx_L1_error))
9172  __pyx_t_10 = 0;
9173  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
9174 
9175  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":779
9176  * cdef LongIndexType* B_index_pointer = NULL
9177  *
9178  * if not B_is_identity: # <<<<<<<<<<<<<<
9179  * B_data = &B_data_mv[0]
9180  * B_indices = &B_indices_mv[0]
9181  */
9182  }
9183 
9184  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":785
9185  *
9186  * # Create a linear operator object
9187  * if B_is_identity: # <<<<<<<<<<<<<<
9188  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double](
9189  * A_data,
9190  */
9191  __Pyx_TraceLine(785,0,__PYX_ERR(0, 785, __pyx_L1_error))
9192  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 785, __pyx_L1_error)
9193  if (__pyx_t_8) {
9194 
9195  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":786
9196  * # Create a linear operator object
9197  * if B_is_identity:
9198  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
9199  * A_data,
9200  * A_indices,
9201  */
9202  __Pyx_TraceLine(786,0,__PYX_ERR(0, 786, __pyx_L1_error))
9203  try {
9204  __pyx_t_11 = new cCSRAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
9205  } catch(...) {
9206  __Pyx_CppExn2PyErr();
9207  __PYX_ERR(0, 786, __pyx_L1_error)
9208  }
9209  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
9210 
9211  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":785
9212  *
9213  * # Create a linear operator object
9214  * if B_is_identity: # <<<<<<<<<<<<<<
9215  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double](
9216  * A_data,
9217  */
9218  goto __pyx_L5;
9219  }
9220 
9221  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":793
9222  * A_num_columns)
9223  * else:
9224  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
9225  * A_data,
9226  * A_indices,
9227  */
9228  __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L1_error))
9229  /*else*/ {
9230 
9231  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":801
9232  * B_data,
9233  * B_indices,
9234  * B_index_pointer) # <<<<<<<<<<<<<<
9235  *
9236  * # ====================
9237  */
9238  __Pyx_TraceLine(801,0,__PYX_ERR(0, 801, __pyx_L1_error))
9239  try {
9240  __pyx_t_11 = new cCSRAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
9241  } catch(...) {
9242  __Pyx_CppExn2PyErr();
9243  __PYX_ERR(0, 793, __pyx_L1_error)
9244  }
9245 
9246  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":793
9247  * A_num_columns)
9248  * else:
9249  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
9250  * A_data,
9251  * A_indices,
9252  */
9253  __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L1_error))
9254  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
9255  }
9256  __pyx_L5:;
9257 
9258  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":736
9259  * # ==========================
9260  *
9261  * def set_csr_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
9262  * """
9263  * """
9264  */
9265 
9266  /* function exit code */
9267  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9268  goto __pyx_L0;
9269  __pyx_L1_error:;
9270  __Pyx_XDECREF(__pyx_t_1);
9271  __Pyx_XDECREF(__pyx_t_2);
9272  __Pyx_XDECREF(__pyx_t_4);
9273  __Pyx_XDECREF(__pyx_t_5);
9274  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
9275  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
9276  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
9277  __pyx_r = NULL;
9278  __pyx_L0:;
9279  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
9280  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
9281  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
9282  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9283  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9284  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9285  __Pyx_XGIVEREF(__pyx_r);
9286  __Pyx_TraceReturn(__pyx_r, 0);
9287  __Pyx_RefNannyFinishContext();
9288  return __pyx_r;
9289 }
9290 
9291 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":807
9292  * # ====================
9293  *
9294  * def set_csc_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
9295  * """
9296  * """
9297  */
9298 
9299 /* Python wrapper */
9300 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9301 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float[] = "pycAffineMatrixFunction.set_csc_matrix_float(self, A, B, B_is_identity)\n\n ";
9302 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float = {"set_csc_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float};
9303 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9304  PyObject *__pyx_v_A = 0;
9305  PyObject *__pyx_v_B = 0;
9306  PyObject *__pyx_v_B_is_identity = 0;
9307  int __pyx_lineno = 0;
9308  const char *__pyx_filename = NULL;
9309  int __pyx_clineno = 0;
9310  PyObject *__pyx_r = 0;
9311  __Pyx_RefNannyDeclarations
9312  __Pyx_RefNannySetupContext("set_csc_matrix_float (wrapper)", 0);
9313  {
9314  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
9315  PyObject* values[3] = {0,0,0};
9316  if (unlikely(__pyx_kwds)) {
9317  Py_ssize_t kw_args;
9318  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9319  switch (pos_args) {
9320  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9321  CYTHON_FALLTHROUGH;
9322  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9323  CYTHON_FALLTHROUGH;
9324  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9325  CYTHON_FALLTHROUGH;
9326  case 0: break;
9327  default: goto __pyx_L5_argtuple_error;
9328  }
9329  kw_args = PyDict_Size(__pyx_kwds);
9330  switch (pos_args) {
9331  case 0:
9332  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
9333  else goto __pyx_L5_argtuple_error;
9334  CYTHON_FALLTHROUGH;
9335  case 1:
9336  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
9337  else {
9338  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 807, __pyx_L3_error)
9339  }
9340  CYTHON_FALLTHROUGH;
9341  case 2:
9342  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
9343  else {
9344  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 807, __pyx_L3_error)
9345  }
9346  }
9347  if (unlikely(kw_args > 0)) {
9348  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csc_matrix_float") < 0)) __PYX_ERR(0, 807, __pyx_L3_error)
9349  }
9350  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9351  goto __pyx_L5_argtuple_error;
9352  } else {
9353  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9354  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9355  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9356  }
9357  __pyx_v_A = values[0];
9358  __pyx_v_B = values[1];
9359  __pyx_v_B_is_identity = values[2];
9360  }
9361  goto __pyx_L4_argument_unpacking_done;
9362  __pyx_L5_argtuple_error:;
9363  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 807, __pyx_L3_error)
9364  __pyx_L3_error:;
9365  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
9366  __Pyx_RefNannyFinishContext();
9367  return NULL;
9368  __pyx_L4_argument_unpacking_done:;
9369  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
9370 
9371  /* function exit code */
9372  __Pyx_RefNannyFinishContext();
9373  return __pyx_r;
9374 }
9375 
9376 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
9377  LongIndexType __pyx_v_A_num_rows;
9378  LongIndexType __pyx_v_A_num_columns;
9379  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9380  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9381  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9382  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9383  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9384  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9385  float *__pyx_v_A_data;
9386  LongIndexType *__pyx_v_A_indices;
9387  LongIndexType *__pyx_v_A_index_pointer;
9388  float *__pyx_v_B_data;
9389  LongIndexType *__pyx_v_B_indices;
9390  LongIndexType *__pyx_v_B_index_pointer;
9391  PyObject *__pyx_r = NULL;
9392  __Pyx_TraceDeclarations
9393  __Pyx_RefNannyDeclarations
9394  PyObject *__pyx_t_1 = NULL;
9395  PyObject *__pyx_t_2 = NULL;
9396  LongIndexType __pyx_t_3;
9397  PyObject *__pyx_t_4 = NULL;
9398  PyObject *__pyx_t_5 = NULL;
9399  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
9400  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
9401  int __pyx_t_8;
9402  int __pyx_t_9;
9403  Py_ssize_t __pyx_t_10;
9404  cCSCAffineMatrixFunction<float> *__pyx_t_11;
9405  int __pyx_lineno = 0;
9406  const char *__pyx_filename = NULL;
9407  int __pyx_clineno = 0;
9408  __Pyx_TraceFrameInit(__pyx_codeobj__15)
9409  __Pyx_RefNannySetupContext("set_csc_matrix_float", 0);
9410  __Pyx_TraceCall("set_csc_matrix_float", __pyx_f[0], 807, 0, __PYX_ERR(0, 807, __pyx_L1_error));
9411 
9412  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":812
9413  *
9414  * # Matrix size
9415  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
9416  * cdef LongIndexType A_num_columns = A.shape[1]
9417  *
9418  */
9419  __Pyx_TraceLine(812,0,__PYX_ERR(0, 812, __pyx_L1_error))
9420  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
9421  __Pyx_GOTREF(__pyx_t_1);
9422  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error)
9423  __Pyx_GOTREF(__pyx_t_2);
9424  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9425  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 812, __pyx_L1_error)
9426  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9427  __pyx_v_A_num_rows = __pyx_t_3;
9428 
9429  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":813
9430  * # Matrix size
9431  * cdef LongIndexType A_num_rows = A.shape[0]
9432  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
9433  *
9434  * # If the input type is the same as LongIndexType, no copy is performed.
9435  */
9436  __Pyx_TraceLine(813,0,__PYX_ERR(0, 813, __pyx_L1_error))
9437  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
9438  __Pyx_GOTREF(__pyx_t_2);
9439  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
9440  __Pyx_GOTREF(__pyx_t_1);
9441  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9442  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 813, __pyx_L1_error)
9443  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9444  __pyx_v_A_num_columns = __pyx_t_3;
9445 
9446  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":817
9447  * # If the input type is the same as LongIndexType, no copy is performed.
9448  * self.A_indices_copy = \
9449  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9450  * self.A_index_pointer_copy = \
9451  * A.indptr.astype(self.long_index_type_name, copy=False)
9452  */
9453  __Pyx_TraceLine(817,0,__PYX_ERR(0, 817, __pyx_L1_error))
9454  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9455  __Pyx_GOTREF(__pyx_t_1);
9456  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
9457  __Pyx_GOTREF(__pyx_t_2);
9458  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9459  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9460  __Pyx_GOTREF(__pyx_t_1);
9461  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error)
9462  __Pyx_GOTREF(__pyx_t_4);
9463  __Pyx_GIVEREF(__pyx_t_1);
9464  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9465  __pyx_t_1 = 0;
9466  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9467  __Pyx_GOTREF(__pyx_t_1);
9468  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
9469  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error)
9470  __Pyx_GOTREF(__pyx_t_5);
9471  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9472  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9473  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9474 
9475  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":816
9476  *
9477  * # If the input type is the same as LongIndexType, no copy is performed.
9478  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
9479  * A.indices.astype(self.long_index_type_name, copy=False)
9480  * self.A_index_pointer_copy = \
9481  */
9482  __Pyx_TraceLine(816,0,__PYX_ERR(0, 816, __pyx_L1_error))
9483  __Pyx_GIVEREF(__pyx_t_5);
9484  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
9485  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
9486  __pyx_v_self->A_indices_copy = __pyx_t_5;
9487  __pyx_t_5 = 0;
9488 
9489  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":819
9490  * A.indices.astype(self.long_index_type_name, copy=False)
9491  * self.A_index_pointer_copy = \
9492  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9493  *
9494  * # Declare memoryviews to get pointers
9495  */
9496  __Pyx_TraceLine(819,0,__PYX_ERR(0, 819, __pyx_L1_error))
9497  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9498  __Pyx_GOTREF(__pyx_t_5);
9499  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
9500  __Pyx_GOTREF(__pyx_t_1);
9501  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9502  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9503  __Pyx_GOTREF(__pyx_t_5);
9504  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L1_error)
9505  __Pyx_GOTREF(__pyx_t_4);
9506  __Pyx_GIVEREF(__pyx_t_5);
9507  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9508  __pyx_t_5 = 0;
9509  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9510  __Pyx_GOTREF(__pyx_t_5);
9511  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 819, __pyx_L1_error)
9512  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
9513  __Pyx_GOTREF(__pyx_t_2);
9514  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9515  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9516  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9517 
9518  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":818
9519  * self.A_indices_copy = \
9520  * A.indices.astype(self.long_index_type_name, copy=False)
9521  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
9522  * A.indptr.astype(self.long_index_type_name, copy=False)
9523  *
9524  */
9525  __Pyx_TraceLine(818,0,__PYX_ERR(0, 818, __pyx_L1_error))
9526  __Pyx_GIVEREF(__pyx_t_2);
9527  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
9528  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
9529  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
9530  __pyx_t_2 = 0;
9531 
9532  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":822
9533  *
9534  * # Declare memoryviews to get pointers
9535  * cdef float[:] A_data_mv = A.data # <<<<<<<<<<<<<<
9536  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
9537  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
9538  */
9539  __Pyx_TraceLine(822,0,__PYX_ERR(0, 822, __pyx_L1_error))
9540  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error)
9541  __Pyx_GOTREF(__pyx_t_2);
9542  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 822, __pyx_L1_error)
9543  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9544  __pyx_v_A_data_mv = __pyx_t_6;
9545  __pyx_t_6.memview = NULL;
9546  __pyx_t_6.data = NULL;
9547 
9548  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":823
9549  * # Declare memoryviews to get pointers
9550  * cdef float[:] A_data_mv = A.data
9551  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
9552  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
9553  * self.A_index_pointer_copy
9554  */
9555  __Pyx_TraceLine(823,0,__PYX_ERR(0, 823, __pyx_L1_error))
9556  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 823, __pyx_L1_error)
9557  __pyx_v_A_indices_mv = __pyx_t_7;
9558  __pyx_t_7.memview = NULL;
9559  __pyx_t_7.data = NULL;
9560 
9561  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":825
9562  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
9563  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
9564  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
9565  * cdef float[:] B_data_mv = None
9566  * cdef MemoryViewLongIndexType B_indices_mv = None
9567  */
9568  __Pyx_TraceLine(825,0,__PYX_ERR(0, 825, __pyx_L1_error))
9569  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 825, __pyx_L1_error)
9570  __pyx_v_A_index_pointer_mv = __pyx_t_7;
9571  __pyx_t_7.memview = NULL;
9572  __pyx_t_7.data = NULL;
9573 
9574  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":826
9575  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
9576  * self.A_index_pointer_copy
9577  * cdef float[:] B_data_mv = None # <<<<<<<<<<<<<<
9578  * cdef MemoryViewLongIndexType B_indices_mv = None
9579  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
9580  */
9581  __Pyx_TraceLine(826,0,__PYX_ERR(0, 826, __pyx_L1_error))
9582  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 826, __pyx_L1_error)
9583  __pyx_v_B_data_mv = __pyx_t_6;
9584  __pyx_t_6.memview = NULL;
9585  __pyx_t_6.data = NULL;
9586 
9587  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":827
9588  * self.A_index_pointer_copy
9589  * cdef float[:] B_data_mv = None
9590  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
9591  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
9592  *
9593  */
9594  __Pyx_TraceLine(827,0,__PYX_ERR(0, 827, __pyx_L1_error))
9595  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 827, __pyx_L1_error)
9596  __pyx_v_B_indices_mv = __pyx_t_7;
9597  __pyx_t_7.memview = NULL;
9598  __pyx_t_7.data = NULL;
9599 
9600  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":828
9601  * cdef float[:] B_data_mv = None
9602  * cdef MemoryViewLongIndexType B_indices_mv = None
9603  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
9604  *
9605  * if not B_is_identity:
9606  */
9607  __Pyx_TraceLine(828,0,__PYX_ERR(0, 828, __pyx_L1_error))
9608  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 828, __pyx_L1_error)
9609  __pyx_v_B_index_pointer_mv = __pyx_t_7;
9610  __pyx_t_7.memview = NULL;
9611  __pyx_t_7.data = NULL;
9612 
9613  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":830
9614  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
9615  *
9616  * if not B_is_identity: # <<<<<<<<<<<<<<
9617  *
9618  * # If input type is the same as LongIndexType, no copy is performed.
9619  */
9620  __Pyx_TraceLine(830,0,__PYX_ERR(0, 830, __pyx_L1_error))
9621  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
9622  __pyx_t_9 = ((!__pyx_t_8) != 0);
9623  if (__pyx_t_9) {
9624 
9625  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":834
9626  * # If input type is the same as LongIndexType, no copy is performed.
9627  * self.B_indices_copy = \
9628  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9629  * self.B_index_pointer_copy = \
9630  * B.indptr.astype(self.long_index_type_name, copy=False)
9631  */
9632  __Pyx_TraceLine(834,0,__PYX_ERR(0, 834, __pyx_L1_error))
9633  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9634  __Pyx_GOTREF(__pyx_t_2);
9635  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 834, __pyx_L1_error)
9636  __Pyx_GOTREF(__pyx_t_5);
9637  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9638  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9639  __Pyx_GOTREF(__pyx_t_2);
9640  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error)
9641  __Pyx_GOTREF(__pyx_t_4);
9642  __Pyx_GIVEREF(__pyx_t_2);
9643  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
9644  __pyx_t_2 = 0;
9645  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9646  __Pyx_GOTREF(__pyx_t_2);
9647  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 834, __pyx_L1_error)
9648  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
9649  __Pyx_GOTREF(__pyx_t_1);
9650  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9651  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9652  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9653 
9654  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":833
9655  *
9656  * # If input type is the same as LongIndexType, no copy is performed.
9657  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
9658  * B.indices.astype(self.long_index_type_name, copy=False)
9659  * self.B_index_pointer_copy = \
9660  */
9661  __Pyx_TraceLine(833,0,__PYX_ERR(0, 833, __pyx_L1_error))
9662  __Pyx_GIVEREF(__pyx_t_1);
9663  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
9664  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
9665  __pyx_v_self->B_indices_copy = __pyx_t_1;
9666  __pyx_t_1 = 0;
9667 
9668  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":836
9669  * B.indices.astype(self.long_index_type_name, copy=False)
9670  * self.B_index_pointer_copy = \
9671  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9672  *
9673  * B_data_mv = B.data
9674  */
9675  __Pyx_TraceLine(836,0,__PYX_ERR(0, 836, __pyx_L1_error))
9676  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9677  __Pyx_GOTREF(__pyx_t_1);
9678  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error)
9679  __Pyx_GOTREF(__pyx_t_2);
9680  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9681  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9682  __Pyx_GOTREF(__pyx_t_1);
9683  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error)
9684  __Pyx_GOTREF(__pyx_t_4);
9685  __Pyx_GIVEREF(__pyx_t_1);
9686  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9687  __pyx_t_1 = 0;
9688  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9689  __Pyx_GOTREF(__pyx_t_1);
9690  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
9691  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error)
9692  __Pyx_GOTREF(__pyx_t_5);
9693  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9694  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9695  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9696 
9697  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":835
9698  * self.B_indices_copy = \
9699  * B.indices.astype(self.long_index_type_name, copy=False)
9700  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
9701  * B.indptr.astype(self.long_index_type_name, copy=False)
9702  *
9703  */
9704  __Pyx_TraceLine(835,0,__PYX_ERR(0, 835, __pyx_L1_error))
9705  __Pyx_GIVEREF(__pyx_t_5);
9706  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
9707  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
9708  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
9709  __pyx_t_5 = 0;
9710 
9711  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":838
9712  * B.indptr.astype(self.long_index_type_name, copy=False)
9713  *
9714  * B_data_mv = B.data # <<<<<<<<<<<<<<
9715  * B_indices_mv = self.B_indices_copy
9716  * B_index_pointer_mv = self.B_index_pointer_copy
9717  */
9718  __Pyx_TraceLine(838,0,__PYX_ERR(0, 838, __pyx_L1_error))
9719  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
9720  __Pyx_GOTREF(__pyx_t_5);
9721  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 838, __pyx_L1_error)
9722  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9723  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9724  __pyx_v_B_data_mv = __pyx_t_6;
9725  __pyx_t_6.memview = NULL;
9726  __pyx_t_6.data = NULL;
9727 
9728  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":839
9729  *
9730  * B_data_mv = B.data
9731  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
9732  * B_index_pointer_mv = self.B_index_pointer_copy
9733  *
9734  */
9735  __Pyx_TraceLine(839,0,__PYX_ERR(0, 839, __pyx_L1_error))
9736  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 839, __pyx_L1_error)
9737  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9738  __pyx_v_B_indices_mv = __pyx_t_7;
9739  __pyx_t_7.memview = NULL;
9740  __pyx_t_7.data = NULL;
9741 
9742  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":840
9743  * B_data_mv = B.data
9744  * B_indices_mv = self.B_indices_copy
9745  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
9746  *
9747  * # Declare pointers
9748  */
9749  __Pyx_TraceLine(840,0,__PYX_ERR(0, 840, __pyx_L1_error))
9750  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 840, __pyx_L1_error)
9751  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9752  __pyx_v_B_index_pointer_mv = __pyx_t_7;
9753  __pyx_t_7.memview = NULL;
9754  __pyx_t_7.data = NULL;
9755 
9756  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":830
9757  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
9758  *
9759  * if not B_is_identity: # <<<<<<<<<<<<<<
9760  *
9761  * # If input type is the same as LongIndexType, no copy is performed.
9762  */
9763  }
9764 
9765  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":843
9766  *
9767  * # Declare pointers
9768  * cdef float* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
9769  * cdef LongIndexType* A_indices = &A_indices_mv[0]
9770  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9771  */
9772  __Pyx_TraceLine(843,0,__PYX_ERR(0, 843, __pyx_L1_error))
9773  __pyx_t_10 = 0;
9774  __pyx_v_A_data = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
9775 
9776  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":844
9777  * # Declare pointers
9778  * cdef float* A_data = &A_data_mv[0]
9779  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
9780  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9781  * cdef float* B_data = NULL
9782  */
9783  __Pyx_TraceLine(844,0,__PYX_ERR(0, 844, __pyx_L1_error))
9784  __pyx_t_10 = 0;
9785  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
9786 
9787  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":845
9788  * cdef float* A_data = &A_data_mv[0]
9789  * cdef LongIndexType* A_indices = &A_indices_mv[0]
9790  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
9791  * cdef float* B_data = NULL
9792  * cdef LongIndexType* B_indices = NULL
9793  */
9794  __Pyx_TraceLine(845,0,__PYX_ERR(0, 845, __pyx_L1_error))
9795  __pyx_t_10 = 0;
9796  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
9797 
9798  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":846
9799  * cdef LongIndexType* A_indices = &A_indices_mv[0]
9800  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9801  * cdef float* B_data = NULL # <<<<<<<<<<<<<<
9802  * cdef LongIndexType* B_indices = NULL
9803  * cdef LongIndexType* B_index_pointer = NULL
9804  */
9805  __Pyx_TraceLine(846,0,__PYX_ERR(0, 846, __pyx_L1_error))
9806  __pyx_v_B_data = NULL;
9807 
9808  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":847
9809  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9810  * cdef float* B_data = NULL
9811  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
9812  * cdef LongIndexType* B_index_pointer = NULL
9813  *
9814  */
9815  __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L1_error))
9816  __pyx_v_B_indices = NULL;
9817 
9818  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":848
9819  * cdef float* B_data = NULL
9820  * cdef LongIndexType* B_indices = NULL
9821  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
9822  *
9823  * if not B_is_identity:
9824  */
9825  __Pyx_TraceLine(848,0,__PYX_ERR(0, 848, __pyx_L1_error))
9826  __pyx_v_B_index_pointer = NULL;
9827 
9828  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":850
9829  * cdef LongIndexType* B_index_pointer = NULL
9830  *
9831  * if not B_is_identity: # <<<<<<<<<<<<<<
9832  * B_data = &B_data_mv[0]
9833  * B_indices = &B_indices_mv[0]
9834  */
9835  __Pyx_TraceLine(850,0,__PYX_ERR(0, 850, __pyx_L1_error))
9836  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 850, __pyx_L1_error)
9837  __pyx_t_8 = ((!__pyx_t_9) != 0);
9838  if (__pyx_t_8) {
9839 
9840  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":851
9841  *
9842  * if not B_is_identity:
9843  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
9844  * B_indices = &B_indices_mv[0]
9845  * B_index_pointer = &B_index_pointer_mv[0]
9846  */
9847  __Pyx_TraceLine(851,0,__PYX_ERR(0, 851, __pyx_L1_error))
9848  __pyx_t_10 = 0;
9849  __pyx_v_B_data = (&(*((float *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
9850 
9851  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":852
9852  * if not B_is_identity:
9853  * B_data = &B_data_mv[0]
9854  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
9855  * B_index_pointer = &B_index_pointer_mv[0]
9856  *
9857  */
9858  __Pyx_TraceLine(852,0,__PYX_ERR(0, 852, __pyx_L1_error))
9859  __pyx_t_10 = 0;
9860  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
9861 
9862  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":853
9863  * B_data = &B_data_mv[0]
9864  * B_indices = &B_indices_mv[0]
9865  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
9866  *
9867  * # Create a linear operator object
9868  */
9869  __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error))
9870  __pyx_t_10 = 0;
9871  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
9872 
9873  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":850
9874  * cdef LongIndexType* B_index_pointer = NULL
9875  *
9876  * if not B_is_identity: # <<<<<<<<<<<<<<
9877  * B_data = &B_data_mv[0]
9878  * B_indices = &B_indices_mv[0]
9879  */
9880  }
9881 
9882  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":856
9883  *
9884  * # Create a linear operator object
9885  * if B_is_identity: # <<<<<<<<<<<<<<
9886  * self.Aop_float = new cCSCAffineMatrixFunction[float](
9887  * A_data,
9888  */
9889  __Pyx_TraceLine(856,0,__PYX_ERR(0, 856, __pyx_L1_error))
9890  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error)
9891  if (__pyx_t_8) {
9892 
9893  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":857
9894  * # Create a linear operator object
9895  * if B_is_identity:
9896  * self.Aop_float = new cCSCAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
9897  * A_data,
9898  * A_indices,
9899  */
9900  __Pyx_TraceLine(857,0,__PYX_ERR(0, 857, __pyx_L1_error))
9901  try {
9902  __pyx_t_11 = new cCSCAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
9903  } catch(...) {
9904  __Pyx_CppExn2PyErr();
9905  __PYX_ERR(0, 857, __pyx_L1_error)
9906  }
9907  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
9908 
9909  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":856
9910  *
9911  * # Create a linear operator object
9912  * if B_is_identity: # <<<<<<<<<<<<<<
9913  * self.Aop_float = new cCSCAffineMatrixFunction[float](
9914  * A_data,
9915  */
9916  goto __pyx_L5;
9917  }
9918 
9919  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":864
9920  * A_num_columns)
9921  * else:
9922  * self.Aop_float = new cCSCAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
9923  * A_data,
9924  * A_indices,
9925  */
9926  __Pyx_TraceLine(864,0,__PYX_ERR(0, 864, __pyx_L1_error))
9927  /*else*/ {
9928 
9929  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":872
9930  * B_data,
9931  * B_indices,
9932  * B_index_pointer) # <<<<<<<<<<<<<<
9933  *
9934  * # =====================
9935  */
9936  __Pyx_TraceLine(872,0,__PYX_ERR(0, 872, __pyx_L1_error))
9937  try {
9938  __pyx_t_11 = new cCSCAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
9939  } catch(...) {
9940  __Pyx_CppExn2PyErr();
9941  __PYX_ERR(0, 864, __pyx_L1_error)
9942  }
9943 
9944  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":864
9945  * A_num_columns)
9946  * else:
9947  * self.Aop_float = new cCSCAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
9948  * A_data,
9949  * A_indices,
9950  */
9951  __Pyx_TraceLine(864,0,__PYX_ERR(0, 864, __pyx_L1_error))
9952  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
9953  }
9954  __pyx_L5:;
9955 
9956  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":807
9957  * # ====================
9958  *
9959  * def set_csc_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
9960  * """
9961  * """
9962  */
9963 
9964  /* function exit code */
9965  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9966  goto __pyx_L0;
9967  __pyx_L1_error:;
9968  __Pyx_XDECREF(__pyx_t_1);
9969  __Pyx_XDECREF(__pyx_t_2);
9970  __Pyx_XDECREF(__pyx_t_4);
9971  __Pyx_XDECREF(__pyx_t_5);
9972  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
9973  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
9974  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
9975  __pyx_r = NULL;
9976  __pyx_L0:;
9977  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
9978  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
9979  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
9980  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9981  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9982  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9983  __Pyx_XGIVEREF(__pyx_r);
9984  __Pyx_TraceReturn(__pyx_r, 0);
9985  __Pyx_RefNannyFinishContext();
9986  return __pyx_r;
9987 }
9988 
9989 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":878
9990  * # =====================
9991  *
9992  * def set_csc_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
9993  * """
9994  * """
9995  */
9996 
9997 /* Python wrapper */
9998 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9999 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double[] = "pycAffineMatrixFunction.set_csc_matrix_double(self, A, B, B_is_identity)\n\n ";
10000 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double = {"set_csc_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double};
10001 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10002  PyObject *__pyx_v_A = 0;
10003  PyObject *__pyx_v_B = 0;
10004  PyObject *__pyx_v_B_is_identity = 0;
10005  int __pyx_lineno = 0;
10006  const char *__pyx_filename = NULL;
10007  int __pyx_clineno = 0;
10008  PyObject *__pyx_r = 0;
10009  __Pyx_RefNannyDeclarations
10010  __Pyx_RefNannySetupContext("set_csc_matrix_double (wrapper)", 0);
10011  {
10012  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
10013  PyObject* values[3] = {0,0,0};
10014  if (unlikely(__pyx_kwds)) {
10015  Py_ssize_t kw_args;
10016  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10017  switch (pos_args) {
10018  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10019  CYTHON_FALLTHROUGH;
10020  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10021  CYTHON_FALLTHROUGH;
10022  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10023  CYTHON_FALLTHROUGH;
10024  case 0: break;
10025  default: goto __pyx_L5_argtuple_error;
10026  }
10027  kw_args = PyDict_Size(__pyx_kwds);
10028  switch (pos_args) {
10029  case 0:
10030  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
10031  else goto __pyx_L5_argtuple_error;
10032  CYTHON_FALLTHROUGH;
10033  case 1:
10034  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
10035  else {
10036  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 878, __pyx_L3_error)
10037  }
10038  CYTHON_FALLTHROUGH;
10039  case 2:
10040  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
10041  else {
10042  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 878, __pyx_L3_error)
10043  }
10044  }
10045  if (unlikely(kw_args > 0)) {
10046  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csc_matrix_double") < 0)) __PYX_ERR(0, 878, __pyx_L3_error)
10047  }
10048  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10049  goto __pyx_L5_argtuple_error;
10050  } else {
10051  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10052  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10053  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10054  }
10055  __pyx_v_A = values[0];
10056  __pyx_v_B = values[1];
10057  __pyx_v_B_is_identity = values[2];
10058  }
10059  goto __pyx_L4_argument_unpacking_done;
10060  __pyx_L5_argtuple_error:;
10061  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 878, __pyx_L3_error)
10062  __pyx_L3_error:;
10063  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10064  __Pyx_RefNannyFinishContext();
10065  return NULL;
10066  __pyx_L4_argument_unpacking_done:;
10067  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
10068 
10069  /* function exit code */
10070  __Pyx_RefNannyFinishContext();
10071  return __pyx_r;
10072 }
10073 
10074 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
10075  LongIndexType __pyx_v_A_num_rows;
10076  LongIndexType __pyx_v_A_num_columns;
10077  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10078  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10079  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10080  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10081  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10082  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10083  double *__pyx_v_A_data;
10084  LongIndexType *__pyx_v_A_indices;
10085  LongIndexType *__pyx_v_A_index_pointer;
10086  double *__pyx_v_B_data;
10087  LongIndexType *__pyx_v_B_indices;
10088  LongIndexType *__pyx_v_B_index_pointer;
10089  PyObject *__pyx_r = NULL;
10090  __Pyx_TraceDeclarations
10091  __Pyx_RefNannyDeclarations
10092  PyObject *__pyx_t_1 = NULL;
10093  PyObject *__pyx_t_2 = NULL;
10094  LongIndexType __pyx_t_3;
10095  PyObject *__pyx_t_4 = NULL;
10096  PyObject *__pyx_t_5 = NULL;
10097  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
10098  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
10099  int __pyx_t_8;
10100  int __pyx_t_9;
10101  Py_ssize_t __pyx_t_10;
10103  int __pyx_lineno = 0;
10104  const char *__pyx_filename = NULL;
10105  int __pyx_clineno = 0;
10106  __Pyx_TraceFrameInit(__pyx_codeobj__16)
10107  __Pyx_RefNannySetupContext("set_csc_matrix_double", 0);
10108  __Pyx_TraceCall("set_csc_matrix_double", __pyx_f[0], 878, 0, __PYX_ERR(0, 878, __pyx_L1_error));
10109 
10110  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":883
10111  *
10112  * # Matrix size
10113  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
10114  * cdef LongIndexType A_num_columns = A.shape[1]
10115  *
10116  */
10117  __Pyx_TraceLine(883,0,__PYX_ERR(0, 883, __pyx_L1_error))
10118  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error)
10119  __Pyx_GOTREF(__pyx_t_1);
10120  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
10121  __Pyx_GOTREF(__pyx_t_2);
10122  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10123  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error)
10124  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10125  __pyx_v_A_num_rows = __pyx_t_3;
10126 
10127  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":884
10128  * # Matrix size
10129  * cdef LongIndexType A_num_rows = A.shape[0]
10130  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
10131  *
10132  * # If the input type is the same as LongIndexType, no copy is performed.
10133  */
10134  __Pyx_TraceLine(884,0,__PYX_ERR(0, 884, __pyx_L1_error))
10135  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error)
10136  __Pyx_GOTREF(__pyx_t_2);
10137  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
10138  __Pyx_GOTREF(__pyx_t_1);
10139  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10140  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
10141  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10142  __pyx_v_A_num_columns = __pyx_t_3;
10143 
10144  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":888
10145  * # If the input type is the same as LongIndexType, no copy is performed.
10146  * self.A_indices_copy = \
10147  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10148  * self.A_index_pointer_copy = \
10149  * A.indptr.astype(self.long_index_type_name, copy=False)
10150  */
10151  __Pyx_TraceLine(888,0,__PYX_ERR(0, 888, __pyx_L1_error))
10152  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
10153  __Pyx_GOTREF(__pyx_t_1);
10154  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
10155  __Pyx_GOTREF(__pyx_t_2);
10156  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10157  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
10158  __Pyx_GOTREF(__pyx_t_1);
10159  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error)
10160  __Pyx_GOTREF(__pyx_t_4);
10161  __Pyx_GIVEREF(__pyx_t_1);
10162  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10163  __pyx_t_1 = 0;
10164  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
10165  __Pyx_GOTREF(__pyx_t_1);
10166  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
10167  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error)
10168  __Pyx_GOTREF(__pyx_t_5);
10169  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10170  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10171  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10172 
10173  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":887
10174  *
10175  * # If the input type is the same as LongIndexType, no copy is performed.
10176  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
10177  * A.indices.astype(self.long_index_type_name, copy=False)
10178  * self.A_index_pointer_copy = \
10179  */
10180  __Pyx_TraceLine(887,0,__PYX_ERR(0, 887, __pyx_L1_error))
10181  __Pyx_GIVEREF(__pyx_t_5);
10182  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
10183  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
10184  __pyx_v_self->A_indices_copy = __pyx_t_5;
10185  __pyx_t_5 = 0;
10186 
10187  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":890
10188  * A.indices.astype(self.long_index_type_name, copy=False)
10189  * self.A_index_pointer_copy = \
10190  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10191  *
10192  * # Declare memoryviews to get pointers
10193  */
10194  __Pyx_TraceLine(890,0,__PYX_ERR(0, 890, __pyx_L1_error))
10195  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
10196  __Pyx_GOTREF(__pyx_t_5);
10197  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
10198  __Pyx_GOTREF(__pyx_t_1);
10199  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10200  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
10201  __Pyx_GOTREF(__pyx_t_5);
10202  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error)
10203  __Pyx_GOTREF(__pyx_t_4);
10204  __Pyx_GIVEREF(__pyx_t_5);
10205  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10206  __pyx_t_5 = 0;
10207  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
10208  __Pyx_GOTREF(__pyx_t_5);
10209  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 890, __pyx_L1_error)
10210  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error)
10211  __Pyx_GOTREF(__pyx_t_2);
10212  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10213  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10214  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10215 
10216  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":889
10217  * self.A_indices_copy = \
10218  * A.indices.astype(self.long_index_type_name, copy=False)
10219  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
10220  * A.indptr.astype(self.long_index_type_name, copy=False)
10221  *
10222  */
10223  __Pyx_TraceLine(889,0,__PYX_ERR(0, 889, __pyx_L1_error))
10224  __Pyx_GIVEREF(__pyx_t_2);
10225  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
10226  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
10227  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
10228  __pyx_t_2 = 0;
10229 
10230  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":893
10231  *
10232  * # Declare memoryviews to get pointers
10233  * cdef double[:] A_data_mv = A.data # <<<<<<<<<<<<<<
10234  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
10235  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10236  */
10237  __Pyx_TraceLine(893,0,__PYX_ERR(0, 893, __pyx_L1_error))
10238  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
10239  __Pyx_GOTREF(__pyx_t_2);
10240  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 893, __pyx_L1_error)
10241  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10242  __pyx_v_A_data_mv = __pyx_t_6;
10243  __pyx_t_6.memview = NULL;
10244  __pyx_t_6.data = NULL;
10245 
10246  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":894
10247  * # Declare memoryviews to get pointers
10248  * cdef double[:] A_data_mv = A.data
10249  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
10250  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10251  * self.A_index_pointer_copy
10252  */
10253  __Pyx_TraceLine(894,0,__PYX_ERR(0, 894, __pyx_L1_error))
10254  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 894, __pyx_L1_error)
10255  __pyx_v_A_indices_mv = __pyx_t_7;
10256  __pyx_t_7.memview = NULL;
10257  __pyx_t_7.data = NULL;
10258 
10259  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":896
10260  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
10261  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10262  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
10263  * cdef double[:] B_data_mv = None
10264  * cdef MemoryViewLongIndexType B_indices_mv = None
10265  */
10266  __Pyx_TraceLine(896,0,__PYX_ERR(0, 896, __pyx_L1_error))
10267  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 896, __pyx_L1_error)
10268  __pyx_v_A_index_pointer_mv = __pyx_t_7;
10269  __pyx_t_7.memview = NULL;
10270  __pyx_t_7.data = NULL;
10271 
10272  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":897
10273  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10274  * self.A_index_pointer_copy
10275  * cdef double[:] B_data_mv = None # <<<<<<<<<<<<<<
10276  * cdef MemoryViewLongIndexType B_indices_mv = None
10277  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10278  */
10279  __Pyx_TraceLine(897,0,__PYX_ERR(0, 897, __pyx_L1_error))
10280  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 897, __pyx_L1_error)
10281  __pyx_v_B_data_mv = __pyx_t_6;
10282  __pyx_t_6.memview = NULL;
10283  __pyx_t_6.data = NULL;
10284 
10285  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":898
10286  * self.A_index_pointer_copy
10287  * cdef double[:] B_data_mv = None
10288  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
10289  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10290  *
10291  */
10292  __Pyx_TraceLine(898,0,__PYX_ERR(0, 898, __pyx_L1_error))
10293  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 898, __pyx_L1_error)
10294  __pyx_v_B_indices_mv = __pyx_t_7;
10295  __pyx_t_7.memview = NULL;
10296  __pyx_t_7.data = NULL;
10297 
10298  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":899
10299  * cdef double[:] B_data_mv = None
10300  * cdef MemoryViewLongIndexType B_indices_mv = None
10301  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
10302  *
10303  * if not B_is_identity:
10304  */
10305  __Pyx_TraceLine(899,0,__PYX_ERR(0, 899, __pyx_L1_error))
10306  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 899, __pyx_L1_error)
10307  __pyx_v_B_index_pointer_mv = __pyx_t_7;
10308  __pyx_t_7.memview = NULL;
10309  __pyx_t_7.data = NULL;
10310 
10311  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":901
10312  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10313  *
10314  * if not B_is_identity: # <<<<<<<<<<<<<<
10315  *
10316  * # If input type is the same as LongIndexType, no copy is performed.
10317  */
10318  __Pyx_TraceLine(901,0,__PYX_ERR(0, 901, __pyx_L1_error))
10319  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
10320  __pyx_t_9 = ((!__pyx_t_8) != 0);
10321  if (__pyx_t_9) {
10322 
10323  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":905
10324  * # If input type is the same as LongIndexType, no copy is performed.
10325  * self.B_indices_copy = \
10326  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10327  * self.B_index_pointer_copy = \
10328  * B.indptr.astype(self.long_index_type_name, copy=False)
10329  */
10330  __Pyx_TraceLine(905,0,__PYX_ERR(0, 905, __pyx_L1_error))
10331  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10332  __Pyx_GOTREF(__pyx_t_2);
10333  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error)
10334  __Pyx_GOTREF(__pyx_t_5);
10335  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10336  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10337  __Pyx_GOTREF(__pyx_t_2);
10338  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error)
10339  __Pyx_GOTREF(__pyx_t_4);
10340  __Pyx_GIVEREF(__pyx_t_2);
10341  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
10342  __pyx_t_2 = 0;
10343  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10344  __Pyx_GOTREF(__pyx_t_2);
10345  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 905, __pyx_L1_error)
10346  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
10347  __Pyx_GOTREF(__pyx_t_1);
10348  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10349  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10350  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10351 
10352  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":904
10353  *
10354  * # If input type is the same as LongIndexType, no copy is performed.
10355  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
10356  * B.indices.astype(self.long_index_type_name, copy=False)
10357  * self.B_index_pointer_copy = \
10358  */
10359  __Pyx_TraceLine(904,0,__PYX_ERR(0, 904, __pyx_L1_error))
10360  __Pyx_GIVEREF(__pyx_t_1);
10361  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
10362  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
10363  __pyx_v_self->B_indices_copy = __pyx_t_1;
10364  __pyx_t_1 = 0;
10365 
10366  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":907
10367  * B.indices.astype(self.long_index_type_name, copy=False)
10368  * self.B_index_pointer_copy = \
10369  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10370  *
10371  * B_data_mv = B.data
10372  */
10373  __Pyx_TraceLine(907,0,__PYX_ERR(0, 907, __pyx_L1_error))
10374  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10375  __Pyx_GOTREF(__pyx_t_1);
10376  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
10377  __Pyx_GOTREF(__pyx_t_2);
10378  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10379  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10380  __Pyx_GOTREF(__pyx_t_1);
10381  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
10382  __Pyx_GOTREF(__pyx_t_4);
10383  __Pyx_GIVEREF(__pyx_t_1);
10384  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10385  __pyx_t_1 = 0;
10386  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10387  __Pyx_GOTREF(__pyx_t_1);
10388  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
10389  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
10390  __Pyx_GOTREF(__pyx_t_5);
10391  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10392  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10393  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10394 
10395  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":906
10396  * self.B_indices_copy = \
10397  * B.indices.astype(self.long_index_type_name, copy=False)
10398  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
10399  * B.indptr.astype(self.long_index_type_name, copy=False)
10400  *
10401  */
10402  __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L1_error))
10403  __Pyx_GIVEREF(__pyx_t_5);
10404  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
10405  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
10406  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
10407  __pyx_t_5 = 0;
10408 
10409  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":909
10410  * B.indptr.astype(self.long_index_type_name, copy=False)
10411  *
10412  * B_data_mv = B.data # <<<<<<<<<<<<<<
10413  * B_indices_mv = self.B_indices_copy
10414  * B_index_pointer_mv = self.B_index_pointer_copy
10415  */
10416  __Pyx_TraceLine(909,0,__PYX_ERR(0, 909, __pyx_L1_error))
10417  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error)
10418  __Pyx_GOTREF(__pyx_t_5);
10419  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 909, __pyx_L1_error)
10420  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10421  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10422  __pyx_v_B_data_mv = __pyx_t_6;
10423  __pyx_t_6.memview = NULL;
10424  __pyx_t_6.data = NULL;
10425 
10426  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":910
10427  *
10428  * B_data_mv = B.data
10429  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
10430  * B_index_pointer_mv = self.B_index_pointer_copy
10431  *
10432  */
10433  __Pyx_TraceLine(910,0,__PYX_ERR(0, 910, __pyx_L1_error))
10434  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 910, __pyx_L1_error)
10435  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10436  __pyx_v_B_indices_mv = __pyx_t_7;
10437  __pyx_t_7.memview = NULL;
10438  __pyx_t_7.data = NULL;
10439 
10440  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":911
10441  * B_data_mv = B.data
10442  * B_indices_mv = self.B_indices_copy
10443  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
10444  *
10445  * # Declare pointers
10446  */
10447  __Pyx_TraceLine(911,0,__PYX_ERR(0, 911, __pyx_L1_error))
10448  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 911, __pyx_L1_error)
10449  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10450  __pyx_v_B_index_pointer_mv = __pyx_t_7;
10451  __pyx_t_7.memview = NULL;
10452  __pyx_t_7.data = NULL;
10453 
10454  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":901
10455  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10456  *
10457  * if not B_is_identity: # <<<<<<<<<<<<<<
10458  *
10459  * # If input type is the same as LongIndexType, no copy is performed.
10460  */
10461  }
10462 
10463  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":914
10464  *
10465  * # Declare pointers
10466  * cdef double* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
10467  * cdef LongIndexType* A_indices = &A_indices_mv[0]
10468  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10469  */
10470  __Pyx_TraceLine(914,0,__PYX_ERR(0, 914, __pyx_L1_error))
10471  __pyx_t_10 = 0;
10472  __pyx_v_A_data = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
10473 
10474  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":915
10475  * # Declare pointers
10476  * cdef double* A_data = &A_data_mv[0]
10477  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
10478  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10479  * cdef double* B_data = NULL
10480  */
10481  __Pyx_TraceLine(915,0,__PYX_ERR(0, 915, __pyx_L1_error))
10482  __pyx_t_10 = 0;
10483  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
10484 
10485  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":916
10486  * cdef double* A_data = &A_data_mv[0]
10487  * cdef LongIndexType* A_indices = &A_indices_mv[0]
10488  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
10489  * cdef double* B_data = NULL
10490  * cdef LongIndexType* B_indices = NULL
10491  */
10492  __Pyx_TraceLine(916,0,__PYX_ERR(0, 916, __pyx_L1_error))
10493  __pyx_t_10 = 0;
10494  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
10495 
10496  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":917
10497  * cdef LongIndexType* A_indices = &A_indices_mv[0]
10498  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10499  * cdef double* B_data = NULL # <<<<<<<<<<<<<<
10500  * cdef LongIndexType* B_indices = NULL
10501  * cdef LongIndexType* B_index_pointer = NULL
10502  */
10503  __Pyx_TraceLine(917,0,__PYX_ERR(0, 917, __pyx_L1_error))
10504  __pyx_v_B_data = NULL;
10505 
10506  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":918
10507  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10508  * cdef double* B_data = NULL
10509  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
10510  * cdef LongIndexType* B_index_pointer = NULL
10511  *
10512  */
10513  __Pyx_TraceLine(918,0,__PYX_ERR(0, 918, __pyx_L1_error))
10514  __pyx_v_B_indices = NULL;
10515 
10516  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":919
10517  * cdef double* B_data = NULL
10518  * cdef LongIndexType* B_indices = NULL
10519  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
10520  *
10521  * if not B_is_identity:
10522  */
10523  __Pyx_TraceLine(919,0,__PYX_ERR(0, 919, __pyx_L1_error))
10524  __pyx_v_B_index_pointer = NULL;
10525 
10526  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":921
10527  * cdef LongIndexType* B_index_pointer = NULL
10528  *
10529  * if not B_is_identity: # <<<<<<<<<<<<<<
10530  * B_data = &B_data_mv[0]
10531  * B_indices = &B_indices_mv[0]
10532  */
10533  __Pyx_TraceLine(921,0,__PYX_ERR(0, 921, __pyx_L1_error))
10534  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 921, __pyx_L1_error)
10535  __pyx_t_8 = ((!__pyx_t_9) != 0);
10536  if (__pyx_t_8) {
10537 
10538  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":922
10539  *
10540  * if not B_is_identity:
10541  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
10542  * B_indices = &B_indices_mv[0]
10543  * B_index_pointer = &B_index_pointer_mv[0]
10544  */
10545  __Pyx_TraceLine(922,0,__PYX_ERR(0, 922, __pyx_L1_error))
10546  __pyx_t_10 = 0;
10547  __pyx_v_B_data = (&(*((double *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
10548 
10549  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":923
10550  * if not B_is_identity:
10551  * B_data = &B_data_mv[0]
10552  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
10553  * B_index_pointer = &B_index_pointer_mv[0]
10554  *
10555  */
10556  __Pyx_TraceLine(923,0,__PYX_ERR(0, 923, __pyx_L1_error))
10557  __pyx_t_10 = 0;
10558  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
10559 
10560  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":924
10561  * B_data = &B_data_mv[0]
10562  * B_indices = &B_indices_mv[0]
10563  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
10564  *
10565  * # Create a linear operator object
10566  */
10567  __Pyx_TraceLine(924,0,__PYX_ERR(0, 924, __pyx_L1_error))
10568  __pyx_t_10 = 0;
10569  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
10570 
10571  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":921
10572  * cdef LongIndexType* B_index_pointer = NULL
10573  *
10574  * if not B_is_identity: # <<<<<<<<<<<<<<
10575  * B_data = &B_data_mv[0]
10576  * B_indices = &B_indices_mv[0]
10577  */
10578  }
10579 
10580  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":927
10581  *
10582  * # Create a linear operator object
10583  * if B_is_identity: # <<<<<<<<<<<<<<
10584  * self.Aop_double = new cCSCAffineMatrixFunction[double](
10585  * A_data,
10586  */
10587  __Pyx_TraceLine(927,0,__PYX_ERR(0, 927, __pyx_L1_error))
10588  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 927, __pyx_L1_error)
10589  if (__pyx_t_8) {
10590 
10591  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":928
10592  * # Create a linear operator object
10593  * if B_is_identity:
10594  * self.Aop_double = new cCSCAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
10595  * A_data,
10596  * A_indices,
10597  */
10598  __Pyx_TraceLine(928,0,__PYX_ERR(0, 928, __pyx_L1_error))
10599  try {
10600  __pyx_t_11 = new cCSCAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
10601  } catch(...) {
10602  __Pyx_CppExn2PyErr();
10603  __PYX_ERR(0, 928, __pyx_L1_error)
10604  }
10605  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
10606 
10607  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":927
10608  *
10609  * # Create a linear operator object
10610  * if B_is_identity: # <<<<<<<<<<<<<<
10611  * self.Aop_double = new cCSCAffineMatrixFunction[double](
10612  * A_data,
10613  */
10614  goto __pyx_L5;
10615  }
10616 
10617  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":935
10618  * A_num_columns)
10619  * else:
10620  * self.Aop_double = new cCSCAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
10621  * A_data,
10622  * A_indices,
10623  */
10624  __Pyx_TraceLine(935,0,__PYX_ERR(0, 935, __pyx_L1_error))
10625  /*else*/ {
10626 
10627  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":943
10628  * B_data,
10629  * B_indices,
10630  * B_index_pointer) # <<<<<<<<<<<<<<
10631  *
10632  * # ==========================
10633  */
10634  __Pyx_TraceLine(943,0,__PYX_ERR(0, 943, __pyx_L1_error))
10635  try {
10636  __pyx_t_11 = new cCSCAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
10637  } catch(...) {
10638  __Pyx_CppExn2PyErr();
10639  __PYX_ERR(0, 935, __pyx_L1_error)
10640  }
10641 
10642  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":935
10643  * A_num_columns)
10644  * else:
10645  * self.Aop_double = new cCSCAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
10646  * A_data,
10647  * A_indices,
10648  */
10649  __Pyx_TraceLine(935,0,__PYX_ERR(0, 935, __pyx_L1_error))
10650  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
10651  }
10652  __pyx_L5:;
10653 
10654  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":878
10655  * # =====================
10656  *
10657  * def set_csc_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
10658  * """
10659  * """
10660  */
10661 
10662  /* function exit code */
10663  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10664  goto __pyx_L0;
10665  __pyx_L1_error:;
10666  __Pyx_XDECREF(__pyx_t_1);
10667  __Pyx_XDECREF(__pyx_t_2);
10668  __Pyx_XDECREF(__pyx_t_4);
10669  __Pyx_XDECREF(__pyx_t_5);
10670  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
10671  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
10672  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10673  __pyx_r = NULL;
10674  __pyx_L0:;
10675  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
10676  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
10677  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
10678  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10679  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10680  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10681  __Pyx_XGIVEREF(__pyx_r);
10682  __Pyx_TraceReturn(__pyx_r, 0);
10683  __Pyx_RefNannyFinishContext();
10684  return __pyx_r;
10685 }
10686 
10687 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":949
10688  * # ==========================
10689  *
10690  * def set_csc_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
10691  * """
10692  * """
10693  */
10694 
10695 /* Python wrapper */
10696 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10697 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double[] = "pycAffineMatrixFunction.set_csc_matrix_long_double(self, A, B, B_is_identity)\n\n ";
10698 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double = {"set_csc_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double};
10699 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10700  PyObject *__pyx_v_A = 0;
10701  PyObject *__pyx_v_B = 0;
10702  PyObject *__pyx_v_B_is_identity = 0;
10703  int __pyx_lineno = 0;
10704  const char *__pyx_filename = NULL;
10705  int __pyx_clineno = 0;
10706  PyObject *__pyx_r = 0;
10707  __Pyx_RefNannyDeclarations
10708  __Pyx_RefNannySetupContext("set_csc_matrix_long_double (wrapper)", 0);
10709  {
10710  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
10711  PyObject* values[3] = {0,0,0};
10712  if (unlikely(__pyx_kwds)) {
10713  Py_ssize_t kw_args;
10714  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10715  switch (pos_args) {
10716  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10717  CYTHON_FALLTHROUGH;
10718  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10719  CYTHON_FALLTHROUGH;
10720  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10721  CYTHON_FALLTHROUGH;
10722  case 0: break;
10723  default: goto __pyx_L5_argtuple_error;
10724  }
10725  kw_args = PyDict_Size(__pyx_kwds);
10726  switch (pos_args) {
10727  case 0:
10728  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
10729  else goto __pyx_L5_argtuple_error;
10730  CYTHON_FALLTHROUGH;
10731  case 1:
10732  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
10733  else {
10734  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 949, __pyx_L3_error)
10735  }
10736  CYTHON_FALLTHROUGH;
10737  case 2:
10738  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
10739  else {
10740  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 949, __pyx_L3_error)
10741  }
10742  }
10743  if (unlikely(kw_args > 0)) {
10744  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csc_matrix_long_double") < 0)) __PYX_ERR(0, 949, __pyx_L3_error)
10745  }
10746  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10747  goto __pyx_L5_argtuple_error;
10748  } else {
10749  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10750  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10751  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10752  }
10753  __pyx_v_A = values[0];
10754  __pyx_v_B = values[1];
10755  __pyx_v_B_is_identity = values[2];
10756  }
10757  goto __pyx_L4_argument_unpacking_done;
10758  __pyx_L5_argtuple_error:;
10759  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 949, __pyx_L3_error)
10760  __pyx_L3_error:;
10761  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10762  __Pyx_RefNannyFinishContext();
10763  return NULL;
10764  __pyx_L4_argument_unpacking_done:;
10765  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
10766 
10767  /* function exit code */
10768  __Pyx_RefNannyFinishContext();
10769  return __pyx_r;
10770 }
10771 
10772 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
10773  LongIndexType __pyx_v_A_num_rows;
10774  LongIndexType __pyx_v_A_num_columns;
10775  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10776  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10777  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10778  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10779  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10780  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10781  long double *__pyx_v_A_data;
10782  LongIndexType *__pyx_v_A_indices;
10783  LongIndexType *__pyx_v_A_index_pointer;
10784  long double *__pyx_v_B_data;
10785  LongIndexType *__pyx_v_B_indices;
10786  LongIndexType *__pyx_v_B_index_pointer;
10787  PyObject *__pyx_r = NULL;
10788  __Pyx_TraceDeclarations
10789  __Pyx_RefNannyDeclarations
10790  PyObject *__pyx_t_1 = NULL;
10791  PyObject *__pyx_t_2 = NULL;
10792  LongIndexType __pyx_t_3;
10793  PyObject *__pyx_t_4 = NULL;
10794  PyObject *__pyx_t_5 = NULL;
10795  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
10796  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
10797  int __pyx_t_8;
10798  int __pyx_t_9;
10799  Py_ssize_t __pyx_t_10;
10801  int __pyx_lineno = 0;
10802  const char *__pyx_filename = NULL;
10803  int __pyx_clineno = 0;
10804  __Pyx_TraceFrameInit(__pyx_codeobj__17)
10805  __Pyx_RefNannySetupContext("set_csc_matrix_long_double", 0);
10806  __Pyx_TraceCall("set_csc_matrix_long_double", __pyx_f[0], 949, 0, __PYX_ERR(0, 949, __pyx_L1_error));
10807 
10808  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":954
10809  *
10810  * # Matrix size
10811  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
10812  * cdef LongIndexType A_num_columns = A.shape[1]
10813  *
10814  */
10815  __Pyx_TraceLine(954,0,__PYX_ERR(0, 954, __pyx_L1_error))
10816  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
10817  __Pyx_GOTREF(__pyx_t_1);
10818  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error)
10819  __Pyx_GOTREF(__pyx_t_2);
10820  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10821  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_2); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L1_error)
10822  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10823  __pyx_v_A_num_rows = __pyx_t_3;
10824 
10825  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":955
10826  * # Matrix size
10827  * cdef LongIndexType A_num_rows = A.shape[0]
10828  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
10829  *
10830  * # If the input type is the same as LongIndexType, no copy is performed.
10831  */
10832  __Pyx_TraceLine(955,0,__PYX_ERR(0, 955, __pyx_L1_error))
10833  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error)
10834  __Pyx_GOTREF(__pyx_t_2);
10835  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
10836  __Pyx_GOTREF(__pyx_t_1);
10837  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10838  __pyx_t_3 = __Pyx_PyInt_As_LongIndexType(__pyx_t_1); if (unlikely((__pyx_t_3 == ((LongIndexType)-1)) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L1_error)
10839  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10840  __pyx_v_A_num_columns = __pyx_t_3;
10841 
10842  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":959
10843  * # If the input type is the same as LongIndexType, no copy is performed.
10844  * self.A_indices_copy = \
10845  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10846  * self.A_index_pointer_copy = \
10847  * A.indptr.astype(self.long_index_type_name, copy=False)
10848  */
10849  __Pyx_TraceLine(959,0,__PYX_ERR(0, 959, __pyx_L1_error))
10850  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10851  __Pyx_GOTREF(__pyx_t_1);
10852  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
10853  __Pyx_GOTREF(__pyx_t_2);
10854  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10855  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10856  __Pyx_GOTREF(__pyx_t_1);
10857  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error)
10858  __Pyx_GOTREF(__pyx_t_4);
10859  __Pyx_GIVEREF(__pyx_t_1);
10860  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10861  __pyx_t_1 = 0;
10862  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10863  __Pyx_GOTREF(__pyx_t_1);
10864  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
10865  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error)
10866  __Pyx_GOTREF(__pyx_t_5);
10867  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10868  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10869  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10870 
10871  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":958
10872  *
10873  * # If the input type is the same as LongIndexType, no copy is performed.
10874  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
10875  * A.indices.astype(self.long_index_type_name, copy=False)
10876  * self.A_index_pointer_copy = \
10877  */
10878  __Pyx_TraceLine(958,0,__PYX_ERR(0, 958, __pyx_L1_error))
10879  __Pyx_GIVEREF(__pyx_t_5);
10880  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
10881  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
10882  __pyx_v_self->A_indices_copy = __pyx_t_5;
10883  __pyx_t_5 = 0;
10884 
10885  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":961
10886  * A.indices.astype(self.long_index_type_name, copy=False)
10887  * self.A_index_pointer_copy = \
10888  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10889  *
10890  * # Declare memoryviews to get pointers
10891  */
10892  __Pyx_TraceLine(961,0,__PYX_ERR(0, 961, __pyx_L1_error))
10893  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10894  __Pyx_GOTREF(__pyx_t_5);
10895  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
10896  __Pyx_GOTREF(__pyx_t_1);
10897  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10898  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10899  __Pyx_GOTREF(__pyx_t_5);
10900  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 961, __pyx_L1_error)
10901  __Pyx_GOTREF(__pyx_t_4);
10902  __Pyx_GIVEREF(__pyx_t_5);
10903  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10904  __pyx_t_5 = 0;
10905  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10906  __Pyx_GOTREF(__pyx_t_5);
10907  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 961, __pyx_L1_error)
10908  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
10909  __Pyx_GOTREF(__pyx_t_2);
10910  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10911  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10912  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10913 
10914  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":960
10915  * self.A_indices_copy = \
10916  * A.indices.astype(self.long_index_type_name, copy=False)
10917  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
10918  * A.indptr.astype(self.long_index_type_name, copy=False)
10919  *
10920  */
10921  __Pyx_TraceLine(960,0,__PYX_ERR(0, 960, __pyx_L1_error))
10922  __Pyx_GIVEREF(__pyx_t_2);
10923  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
10924  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
10925  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
10926  __pyx_t_2 = 0;
10927 
10928  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":964
10929  *
10930  * # Declare memoryviews to get pointers
10931  * cdef long double[:] A_data_mv = A.data # <<<<<<<<<<<<<<
10932  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
10933  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10934  */
10935  __Pyx_TraceLine(964,0,__PYX_ERR(0, 964, __pyx_L1_error))
10936  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
10937  __Pyx_GOTREF(__pyx_t_2);
10938  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 964, __pyx_L1_error)
10939  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10940  __pyx_v_A_data_mv = __pyx_t_6;
10941  __pyx_t_6.memview = NULL;
10942  __pyx_t_6.data = NULL;
10943 
10944  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":965
10945  * # Declare memoryviews to get pointers
10946  * cdef long double[:] A_data_mv = A.data
10947  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
10948  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10949  * self.A_index_pointer_copy
10950  */
10951  __Pyx_TraceLine(965,0,__PYX_ERR(0, 965, __pyx_L1_error))
10952  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 965, __pyx_L1_error)
10953  __pyx_v_A_indices_mv = __pyx_t_7;
10954  __pyx_t_7.memview = NULL;
10955  __pyx_t_7.data = NULL;
10956 
10957  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":967
10958  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
10959  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10960  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
10961  * cdef long double[:] B_data_mv = None
10962  * cdef MemoryViewLongIndexType B_indices_mv = None
10963  */
10964  __Pyx_TraceLine(967,0,__PYX_ERR(0, 967, __pyx_L1_error))
10965  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 967, __pyx_L1_error)
10966  __pyx_v_A_index_pointer_mv = __pyx_t_7;
10967  __pyx_t_7.memview = NULL;
10968  __pyx_t_7.data = NULL;
10969 
10970  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":968
10971  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10972  * self.A_index_pointer_copy
10973  * cdef long double[:] B_data_mv = None # <<<<<<<<<<<<<<
10974  * cdef MemoryViewLongIndexType B_indices_mv = None
10975  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10976  */
10977  __Pyx_TraceLine(968,0,__PYX_ERR(0, 968, __pyx_L1_error))
10978  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 968, __pyx_L1_error)
10979  __pyx_v_B_data_mv = __pyx_t_6;
10980  __pyx_t_6.memview = NULL;
10981  __pyx_t_6.data = NULL;
10982 
10983  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":969
10984  * self.A_index_pointer_copy
10985  * cdef long double[:] B_data_mv = None
10986  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
10987  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10988  *
10989  */
10990  __Pyx_TraceLine(969,0,__PYX_ERR(0, 969, __pyx_L1_error))
10991  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 969, __pyx_L1_error)
10992  __pyx_v_B_indices_mv = __pyx_t_7;
10993  __pyx_t_7.memview = NULL;
10994  __pyx_t_7.data = NULL;
10995 
10996  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":970
10997  * cdef long double[:] B_data_mv = None
10998  * cdef MemoryViewLongIndexType B_indices_mv = None
10999  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
11000  *
11001  * if not B_is_identity:
11002  */
11003  __Pyx_TraceLine(970,0,__PYX_ERR(0, 970, __pyx_L1_error))
11004  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 970, __pyx_L1_error)
11005  __pyx_v_B_index_pointer_mv = __pyx_t_7;
11006  __pyx_t_7.memview = NULL;
11007  __pyx_t_7.data = NULL;
11008 
11009  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":972
11010  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
11011  *
11012  * if not B_is_identity: # <<<<<<<<<<<<<<
11013  *
11014  * # If input type is the same as LongIndexType, no copy is performed.
11015  */
11016  __Pyx_TraceLine(972,0,__PYX_ERR(0, 972, __pyx_L1_error))
11017  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 972, __pyx_L1_error)
11018  __pyx_t_9 = ((!__pyx_t_8) != 0);
11019  if (__pyx_t_9) {
11020 
11021  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":976
11022  * # If input type is the same as LongIndexType, no copy is performed.
11023  * self.B_indices_copy = \
11024  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
11025  * self.B_index_pointer_copy = \
11026  * B.indptr.astype(self.long_index_type_name, copy=False)
11027  */
11028  __Pyx_TraceLine(976,0,__PYX_ERR(0, 976, __pyx_L1_error))
11029  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
11030  __Pyx_GOTREF(__pyx_t_2);
11031  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
11032  __Pyx_GOTREF(__pyx_t_5);
11033  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11034  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
11035  __Pyx_GOTREF(__pyx_t_2);
11036  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
11037  __Pyx_GOTREF(__pyx_t_4);
11038  __Pyx_GIVEREF(__pyx_t_2);
11039  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
11040  __pyx_t_2 = 0;
11041  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
11042  __Pyx_GOTREF(__pyx_t_2);
11043  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 976, __pyx_L1_error)
11044  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
11045  __Pyx_GOTREF(__pyx_t_1);
11046  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11047  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11048  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11049 
11050  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":975
11051  *
11052  * # If input type is the same as LongIndexType, no copy is performed.
11053  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
11054  * B.indices.astype(self.long_index_type_name, copy=False)
11055  * self.B_index_pointer_copy = \
11056  */
11057  __Pyx_TraceLine(975,0,__PYX_ERR(0, 975, __pyx_L1_error))
11058  __Pyx_GIVEREF(__pyx_t_1);
11059  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
11060  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
11061  __pyx_v_self->B_indices_copy = __pyx_t_1;
11062  __pyx_t_1 = 0;
11063 
11064  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":978
11065  * B.indices.astype(self.long_index_type_name, copy=False)
11066  * self.B_index_pointer_copy = \
11067  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
11068  *
11069  * B_data_mv = B.data
11070  */
11071  __Pyx_TraceLine(978,0,__PYX_ERR(0, 978, __pyx_L1_error))
11072  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
11073  __Pyx_GOTREF(__pyx_t_1);
11074  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
11075  __Pyx_GOTREF(__pyx_t_2);
11076  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11077  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
11078  __Pyx_GOTREF(__pyx_t_1);
11079  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error)
11080  __Pyx_GOTREF(__pyx_t_4);
11081  __Pyx_GIVEREF(__pyx_t_1);
11082  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
11083  __pyx_t_1 = 0;
11084  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
11085  __Pyx_GOTREF(__pyx_t_1);
11086  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 978, __pyx_L1_error)
11087  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
11088  __Pyx_GOTREF(__pyx_t_5);
11089  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11090  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11091  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11092 
11093  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":977
11094  * self.B_indices_copy = \
11095  * B.indices.astype(self.long_index_type_name, copy=False)
11096  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
11097  * B.indptr.astype(self.long_index_type_name, copy=False)
11098  *
11099  */
11100  __Pyx_TraceLine(977,0,__PYX_ERR(0, 977, __pyx_L1_error))
11101  __Pyx_GIVEREF(__pyx_t_5);
11102  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
11103  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
11104  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
11105  __pyx_t_5 = 0;
11106 
11107  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":980
11108  * B.indptr.astype(self.long_index_type_name, copy=False)
11109  *
11110  * B_data_mv = B.data # <<<<<<<<<<<<<<
11111  * B_indices_mv = self.B_indices_copy
11112  * B_index_pointer_mv = self.B_index_pointer_copy
11113  */
11114  __Pyx_TraceLine(980,0,__PYX_ERR(0, 980, __pyx_L1_error))
11115  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error)
11116  __Pyx_GOTREF(__pyx_t_5);
11117  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 980, __pyx_L1_error)
11118  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11119  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
11120  __pyx_v_B_data_mv = __pyx_t_6;
11121  __pyx_t_6.memview = NULL;
11122  __pyx_t_6.data = NULL;
11123 
11124  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":981
11125  *
11126  * B_data_mv = B.data
11127  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
11128  * B_index_pointer_mv = self.B_index_pointer_copy
11129  *
11130  */
11131  __Pyx_TraceLine(981,0,__PYX_ERR(0, 981, __pyx_L1_error))
11132  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 981, __pyx_L1_error)
11133  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
11134  __pyx_v_B_indices_mv = __pyx_t_7;
11135  __pyx_t_7.memview = NULL;
11136  __pyx_t_7.data = NULL;
11137 
11138  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":982
11139  * B_data_mv = B.data
11140  * B_indices_mv = self.B_indices_copy
11141  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
11142  *
11143  * # Declare pointers
11144  */
11145  __Pyx_TraceLine(982,0,__PYX_ERR(0, 982, __pyx_L1_error))
11146  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 982, __pyx_L1_error)
11147  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
11148  __pyx_v_B_index_pointer_mv = __pyx_t_7;
11149  __pyx_t_7.memview = NULL;
11150  __pyx_t_7.data = NULL;
11151 
11152  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":972
11153  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
11154  *
11155  * if not B_is_identity: # <<<<<<<<<<<<<<
11156  *
11157  * # If input type is the same as LongIndexType, no copy is performed.
11158  */
11159  }
11160 
11161  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":985
11162  *
11163  * # Declare pointers
11164  * cdef long double* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
11165  * cdef LongIndexType* A_indices = &A_indices_mv[0]
11166  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
11167  */
11168  __Pyx_TraceLine(985,0,__PYX_ERR(0, 985, __pyx_L1_error))
11169  __pyx_t_10 = 0;
11170  __pyx_v_A_data = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
11171 
11172  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":986
11173  * # Declare pointers
11174  * cdef long double* A_data = &A_data_mv[0]
11175  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
11176  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
11177  * cdef long double* B_data = NULL
11178  */
11179  __Pyx_TraceLine(986,0,__PYX_ERR(0, 986, __pyx_L1_error))
11180  __pyx_t_10 = 0;
11181  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
11182 
11183  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":987
11184  * cdef long double* A_data = &A_data_mv[0]
11185  * cdef LongIndexType* A_indices = &A_indices_mv[0]
11186  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
11187  * cdef long double* B_data = NULL
11188  * cdef LongIndexType* B_indices = NULL
11189  */
11190  __Pyx_TraceLine(987,0,__PYX_ERR(0, 987, __pyx_L1_error))
11191  __pyx_t_10 = 0;
11192  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
11193 
11194  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":988
11195  * cdef LongIndexType* A_indices = &A_indices_mv[0]
11196  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
11197  * cdef long double* B_data = NULL # <<<<<<<<<<<<<<
11198  * cdef LongIndexType* B_indices = NULL
11199  * cdef LongIndexType* B_index_pointer = NULL
11200  */
11201  __Pyx_TraceLine(988,0,__PYX_ERR(0, 988, __pyx_L1_error))
11202  __pyx_v_B_data = NULL;
11203 
11204  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":989
11205  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
11206  * cdef long double* B_data = NULL
11207  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
11208  * cdef LongIndexType* B_index_pointer = NULL
11209  *
11210  */
11211  __Pyx_TraceLine(989,0,__PYX_ERR(0, 989, __pyx_L1_error))
11212  __pyx_v_B_indices = NULL;
11213 
11214  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":990
11215  * cdef long double* B_data = NULL
11216  * cdef LongIndexType* B_indices = NULL
11217  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
11218  *
11219  * if not B_is_identity:
11220  */
11221  __Pyx_TraceLine(990,0,__PYX_ERR(0, 990, __pyx_L1_error))
11222  __pyx_v_B_index_pointer = NULL;
11223 
11224  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":992
11225  * cdef LongIndexType* B_index_pointer = NULL
11226  *
11227  * if not B_is_identity: # <<<<<<<<<<<<<<
11228  * B_data = &B_data_mv[0]
11229  * B_indices = &B_indices_mv[0]
11230  */
11231  __Pyx_TraceLine(992,0,__PYX_ERR(0, 992, __pyx_L1_error))
11232  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 992, __pyx_L1_error)
11233  __pyx_t_8 = ((!__pyx_t_9) != 0);
11234  if (__pyx_t_8) {
11235 
11236  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":993
11237  *
11238  * if not B_is_identity:
11239  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
11240  * B_indices = &B_indices_mv[0]
11241  * B_index_pointer = &B_index_pointer_mv[0]
11242  */
11243  __Pyx_TraceLine(993,0,__PYX_ERR(0, 993, __pyx_L1_error))
11244  __pyx_t_10 = 0;
11245  __pyx_v_B_data = (&(*((long double *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
11246 
11247  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":994
11248  * if not B_is_identity:
11249  * B_data = &B_data_mv[0]
11250  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
11251  * B_index_pointer = &B_index_pointer_mv[0]
11252  *
11253  */
11254  __Pyx_TraceLine(994,0,__PYX_ERR(0, 994, __pyx_L1_error))
11255  __pyx_t_10 = 0;
11256  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
11257 
11258  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":995
11259  * B_data = &B_data_mv[0]
11260  * B_indices = &B_indices_mv[0]
11261  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
11262  *
11263  * # Create a linear operator object
11264  */
11265  __Pyx_TraceLine(995,0,__PYX_ERR(0, 995, __pyx_L1_error))
11266  __pyx_t_10 = 0;
11267  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
11268 
11269  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":992
11270  * cdef LongIndexType* B_index_pointer = NULL
11271  *
11272  * if not B_is_identity: # <<<<<<<<<<<<<<
11273  * B_data = &B_data_mv[0]
11274  * B_indices = &B_indices_mv[0]
11275  */
11276  }
11277 
11278  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":998
11279  *
11280  * # Create a linear operator object
11281  * if B_is_identity: # <<<<<<<<<<<<<<
11282  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double](
11283  * A_data,
11284  */
11285  __Pyx_TraceLine(998,0,__PYX_ERR(0, 998, __pyx_L1_error))
11286  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
11287  if (__pyx_t_8) {
11288 
11289  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":999
11290  * # Create a linear operator object
11291  * if B_is_identity:
11292  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
11293  * A_data,
11294  * A_indices,
11295  */
11296  __Pyx_TraceLine(999,0,__PYX_ERR(0, 999, __pyx_L1_error))
11297  try {
11298  __pyx_t_11 = new cCSCAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
11299  } catch(...) {
11300  __Pyx_CppExn2PyErr();
11301  __PYX_ERR(0, 999, __pyx_L1_error)
11302  }
11303  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
11304 
11305  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":998
11306  *
11307  * # Create a linear operator object
11308  * if B_is_identity: # <<<<<<<<<<<<<<
11309  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double](
11310  * A_data,
11311  */
11312  goto __pyx_L5;
11313  }
11314 
11315  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":1006
11316  * A_num_columns)
11317  * else:
11318  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
11319  * A_data,
11320  * A_indices,
11321  */
11322  __Pyx_TraceLine(1006,0,__PYX_ERR(0, 1006, __pyx_L1_error))
11323  /*else*/ {
11324 
11325  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":1014
11326  * B_data,
11327  * B_indices,
11328  * B_index_pointer) # <<<<<<<<<<<<<<
11329  */
11330  __Pyx_TraceLine(1014,0,__PYX_ERR(0, 1014, __pyx_L1_error))
11331  try {
11332  __pyx_t_11 = new cCSCAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
11333  } catch(...) {
11334  __Pyx_CppExn2PyErr();
11335  __PYX_ERR(0, 1006, __pyx_L1_error)
11336  }
11337 
11338  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":1006
11339  * A_num_columns)
11340  * else:
11341  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
11342  * A_data,
11343  * A_indices,
11344  */
11345  __Pyx_TraceLine(1006,0,__PYX_ERR(0, 1006, __pyx_L1_error))
11346  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
11347  }
11348  __pyx_L5:;
11349 
11350  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":949
11351  * # ==========================
11352  *
11353  * def set_csc_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
11354  * """
11355  * """
11356  */
11357 
11358  /* function exit code */
11359  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11360  goto __pyx_L0;
11361  __pyx_L1_error:;
11362  __Pyx_XDECREF(__pyx_t_1);
11363  __Pyx_XDECREF(__pyx_t_2);
11364  __Pyx_XDECREF(__pyx_t_4);
11365  __Pyx_XDECREF(__pyx_t_5);
11366  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
11367  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
11368  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
11369  __pyx_r = NULL;
11370  __pyx_L0:;
11371  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
11372  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
11373  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
11374  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
11375  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
11376  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
11377  __Pyx_XGIVEREF(__pyx_r);
11378  __Pyx_TraceReturn(__pyx_r, 0);
11379  __Pyx_RefNannyFinishContext();
11380  return __pyx_r;
11381 }
11382 
11383 /* "(tree fragment)":1
11384  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11385  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11386  * def __setstate_cython__(self, __pyx_state):
11387  */
11388 
11389 /* Python wrapper */
11390 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11391 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__[] = "pycAffineMatrixFunction.__reduce_cython__(self)";
11392 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__};
11393 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11394  PyObject *__pyx_r = 0;
11395  __Pyx_RefNannyDeclarations
11396  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11397  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self));
11398 
11399  /* function exit code */
11400  __Pyx_RefNannyFinishContext();
11401  return __pyx_r;
11402 }
11403 
11404 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self) {
11405  PyObject *__pyx_r = NULL;
11406  __Pyx_TraceDeclarations
11407  __Pyx_RefNannyDeclarations
11408  PyObject *__pyx_t_1 = NULL;
11409  int __pyx_lineno = 0;
11410  const char *__pyx_filename = NULL;
11411  int __pyx_clineno = 0;
11412  __Pyx_TraceFrameInit(__pyx_codeobj__18)
11413  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11414  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
11415 
11416  /* "(tree fragment)":2
11417  * def __reduce_cython__(self):
11418  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11419  * def __setstate_cython__(self, __pyx_state):
11420  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11421  */
11422  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
11423  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11424  __Pyx_GOTREF(__pyx_t_1);
11425  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11426  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11427  __PYX_ERR(1, 2, __pyx_L1_error)
11428 
11429  /* "(tree fragment)":1
11430  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11431  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11432  * def __setstate_cython__(self, __pyx_state):
11433  */
11434 
11435  /* function exit code */
11436  __pyx_L1_error:;
11437  __Pyx_XDECREF(__pyx_t_1);
11438  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11439  __pyx_r = NULL;
11440  __Pyx_XGIVEREF(__pyx_r);
11441  __Pyx_TraceReturn(__pyx_r, 0);
11442  __Pyx_RefNannyFinishContext();
11443  return __pyx_r;
11444 }
11445 
11446 /* "(tree fragment)":3
11447  * def __reduce_cython__(self):
11448  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11449  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11450  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11451  */
11452 
11453 /* Python wrapper */
11454 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11455 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__[] = "pycAffineMatrixFunction.__setstate_cython__(self, __pyx_state)";
11456 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__};
11457 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11458  PyObject *__pyx_r = 0;
11459  __Pyx_RefNannyDeclarations
11460  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11461  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11462 
11463  /* function exit code */
11464  __Pyx_RefNannyFinishContext();
11465  return __pyx_r;
11466 }
11467 
11468 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11469  PyObject *__pyx_r = NULL;
11470  __Pyx_TraceDeclarations
11471  __Pyx_RefNannyDeclarations
11472  PyObject *__pyx_t_1 = NULL;
11473  int __pyx_lineno = 0;
11474  const char *__pyx_filename = NULL;
11475  int __pyx_clineno = 0;
11476  __Pyx_TraceFrameInit(__pyx_codeobj__20)
11477  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11478  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
11479 
11480  /* "(tree fragment)":4
11481  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11482  * def __setstate_cython__(self, __pyx_state):
11483  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11484  */
11485  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
11486  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11487  __Pyx_GOTREF(__pyx_t_1);
11488  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11489  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11490  __PYX_ERR(1, 4, __pyx_L1_error)
11491 
11492  /* "(tree fragment)":3
11493  * def __reduce_cython__(self):
11494  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11495  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11496  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11497  */
11498 
11499  /* function exit code */
11500  __pyx_L1_error:;
11501  __Pyx_XDECREF(__pyx_t_1);
11502  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11503  __pyx_r = NULL;
11504  __Pyx_XGIVEREF(__pyx_r);
11505  __Pyx_TraceReturn(__pyx_r, 0);
11506  __Pyx_RefNannyFinishContext();
11507  return __pyx_r;
11508 }
11509 
11510 /* "View.MemoryView":123
11511  * cdef bint dtype_is_object
11512  *
11513  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
11514  * mode="c", bint allocate_buffer=True):
11515  *
11516  */
11517 
11518 /* Python wrapper */
11519 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11520 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11521  PyObject *__pyx_v_shape = 0;
11522  Py_ssize_t __pyx_v_itemsize;
11523  PyObject *__pyx_v_format = 0;
11524  PyObject *__pyx_v_mode = 0;
11525  int __pyx_v_allocate_buffer;
11526  int __pyx_lineno = 0;
11527  const char *__pyx_filename = NULL;
11528  int __pyx_clineno = 0;
11529  int __pyx_r;
11530  __Pyx_RefNannyDeclarations
11531  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11532  {
11533  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
11534  PyObject* values[5] = {0,0,0,0,0};
11535  values[3] = ((PyObject *)__pyx_n_s_c);
11536  if (unlikely(__pyx_kwds)) {
11537  Py_ssize_t kw_args;
11538  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11539  switch (pos_args) {
11540  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11541  CYTHON_FALLTHROUGH;
11542  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11543  CYTHON_FALLTHROUGH;
11544  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11545  CYTHON_FALLTHROUGH;
11546  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11547  CYTHON_FALLTHROUGH;
11548  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11549  CYTHON_FALLTHROUGH;
11550  case 0: break;
11551  default: goto __pyx_L5_argtuple_error;
11552  }
11553  kw_args = PyDict_Size(__pyx_kwds);
11554  switch (pos_args) {
11555  case 0:
11556  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
11557  else goto __pyx_L5_argtuple_error;
11558  CYTHON_FALLTHROUGH;
11559  case 1:
11560  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
11561  else {
11562  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
11563  }
11564  CYTHON_FALLTHROUGH;
11565  case 2:
11566  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
11567  else {
11568  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
11569  }
11570  CYTHON_FALLTHROUGH;
11571  case 3:
11572  if (kw_args > 0) {
11573  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
11574  if (value) { values[3] = value; kw_args--; }
11575  }
11576  CYTHON_FALLTHROUGH;
11577  case 4:
11578  if (kw_args > 0) {
11579  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
11580  if (value) { values[4] = value; kw_args--; }
11581  }
11582  }
11583  if (unlikely(kw_args > 0)) {
11584  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
11585  }
11586  } else {
11587  switch (PyTuple_GET_SIZE(__pyx_args)) {
11588  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11589  CYTHON_FALLTHROUGH;
11590  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11591  CYTHON_FALLTHROUGH;
11592  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11593  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11594  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11595  break;
11596  default: goto __pyx_L5_argtuple_error;
11597  }
11598  }
11599  __pyx_v_shape = ((PyObject*)values[0]);
11600  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
11601  __pyx_v_format = values[2];
11602  __pyx_v_mode = values[3];
11603  if (values[4]) {
11604  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
11605  } else {
11606 
11607  /* "View.MemoryView":124
11608  *
11609  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
11610  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
11611  *
11612  * cdef int idx
11613  */
11614  __pyx_v_allocate_buffer = ((int)1);
11615  }
11616  }
11617  goto __pyx_L4_argument_unpacking_done;
11618  __pyx_L5_argtuple_error:;
11619  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
11620  __pyx_L3_error:;
11621  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11622  __Pyx_RefNannyFinishContext();
11623  return -1;
11624  __pyx_L4_argument_unpacking_done:;
11625  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
11626  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
11627  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 123, __pyx_L1_error)
11628  }
11629  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
11630 
11631  /* "View.MemoryView":123
11632  * cdef bint dtype_is_object
11633  *
11634  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
11635  * mode="c", bint allocate_buffer=True):
11636  *
11637  */
11638 
11639  /* function exit code */
11640  goto __pyx_L0;
11641  __pyx_L1_error:;
11642  __pyx_r = -1;
11643  __pyx_L0:;
11644  __Pyx_RefNannyFinishContext();
11645  return __pyx_r;
11646 }
11647 
11648 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
11649  int __pyx_v_idx;
11650  Py_ssize_t __pyx_v_i;
11651  Py_ssize_t __pyx_v_dim;
11652  PyObject **__pyx_v_p;
11653  char __pyx_v_order;
11654  int __pyx_r;
11655  __Pyx_TraceDeclarations
11656  __Pyx_RefNannyDeclarations
11657  Py_ssize_t __pyx_t_1;
11658  int __pyx_t_2;
11659  PyObject *__pyx_t_3 = NULL;
11660  int __pyx_t_4;
11661  PyObject *__pyx_t_5 = NULL;
11662  PyObject *__pyx_t_6 = NULL;
11663  char *__pyx_t_7;
11664  int __pyx_t_8;
11665  Py_ssize_t __pyx_t_9;
11666  PyObject *__pyx_t_10 = NULL;
11667  Py_ssize_t __pyx_t_11;
11668  int __pyx_lineno = 0;
11669  const char *__pyx_filename = NULL;
11670  int __pyx_clineno = 0;
11671  __Pyx_RefNannySetupContext("__cinit__", 0);
11672  __Pyx_TraceCall("__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
11673  __Pyx_INCREF(__pyx_v_format);
11674 
11675  /* "View.MemoryView":130
11676  * cdef PyObject **p
11677  *
11678  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
11679  * self.itemsize = itemsize
11680  *
11681  */
11682  __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
11683  if (unlikely(__pyx_v_shape == Py_None)) {
11684  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
11685  __PYX_ERR(1, 130, __pyx_L1_error)
11686  }
11687  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
11688  __pyx_v_self->ndim = ((int)__pyx_t_1);
11689 
11690  /* "View.MemoryView":131
11691  *
11692  * self.ndim = <int> len(shape)
11693  * self.itemsize = itemsize # <<<<<<<<<<<<<<
11694  *
11695  * if not self.ndim:
11696  */
11697  __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
11698  __pyx_v_self->itemsize = __pyx_v_itemsize;
11699 
11700  /* "View.MemoryView":133
11701  * self.itemsize = itemsize
11702  *
11703  * if not self.ndim: # <<<<<<<<<<<<<<
11704  * raise ValueError("Empty shape tuple for cython.array")
11705  *
11706  */
11707  __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
11708  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
11709  if (unlikely(__pyx_t_2)) {
11710 
11711  /* "View.MemoryView":134
11712  *
11713  * if not self.ndim:
11714  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
11715  *
11716  * if itemsize <= 0:
11717  */
11718  __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
11719  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
11720  __Pyx_GOTREF(__pyx_t_3);
11721  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11722  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11723  __PYX_ERR(1, 134, __pyx_L1_error)
11724 
11725  /* "View.MemoryView":133
11726  * self.itemsize = itemsize
11727  *
11728  * if not self.ndim: # <<<<<<<<<<<<<<
11729  * raise ValueError("Empty shape tuple for cython.array")
11730  *
11731  */
11732  }
11733 
11734  /* "View.MemoryView":136
11735  * raise ValueError("Empty shape tuple for cython.array")
11736  *
11737  * if itemsize <= 0: # <<<<<<<<<<<<<<
11738  * raise ValueError("itemsize <= 0 for cython.array")
11739  *
11740  */
11741  __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
11742  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
11743  if (unlikely(__pyx_t_2)) {
11744 
11745  /* "View.MemoryView":137
11746  *
11747  * if itemsize <= 0:
11748  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
11749  *
11750  * if not isinstance(format, bytes):
11751  */
11752  __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
11753  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
11754  __Pyx_GOTREF(__pyx_t_3);
11755  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11756  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11757  __PYX_ERR(1, 137, __pyx_L1_error)
11758 
11759  /* "View.MemoryView":136
11760  * raise ValueError("Empty shape tuple for cython.array")
11761  *
11762  * if itemsize <= 0: # <<<<<<<<<<<<<<
11763  * raise ValueError("itemsize <= 0 for cython.array")
11764  *
11765  */
11766  }
11767 
11768  /* "View.MemoryView":139
11769  * raise ValueError("itemsize <= 0 for cython.array")
11770  *
11771  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
11772  * format = format.encode('ASCII')
11773  * self._format = format # keep a reference to the byte string
11774  */
11775  __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
11776  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
11777  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
11778  if (__pyx_t_4) {
11779 
11780  /* "View.MemoryView":140
11781  *
11782  * if not isinstance(format, bytes):
11783  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
11784  * self._format = format # keep a reference to the byte string
11785  * self.format = self._format
11786  */
11787  __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
11788  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
11789  __Pyx_GOTREF(__pyx_t_5);
11790  __pyx_t_6 = NULL;
11791  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11792  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
11793  if (likely(__pyx_t_6)) {
11794  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11795  __Pyx_INCREF(__pyx_t_6);
11796  __Pyx_INCREF(function);
11797  __Pyx_DECREF_SET(__pyx_t_5, function);
11798  }
11799  }
11800  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
11801  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11802  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
11803  __Pyx_GOTREF(__pyx_t_3);
11804  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11805  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
11806  __pyx_t_3 = 0;
11807 
11808  /* "View.MemoryView":139
11809  * raise ValueError("itemsize <= 0 for cython.array")
11810  *
11811  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
11812  * format = format.encode('ASCII')
11813  * self._format = format # keep a reference to the byte string
11814  */
11815  }
11816 
11817  /* "View.MemoryView":141
11818  * if not isinstance(format, bytes):
11819  * format = format.encode('ASCII')
11820  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
11821  * self.format = self._format
11822  *
11823  */
11824  __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
11825  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
11826  __pyx_t_3 = __pyx_v_format;
11827  __Pyx_INCREF(__pyx_t_3);
11828  __Pyx_GIVEREF(__pyx_t_3);
11829  __Pyx_GOTREF(__pyx_v_self->_format);
11830  __Pyx_DECREF(__pyx_v_self->_format);
11831  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
11832  __pyx_t_3 = 0;
11833 
11834  /* "View.MemoryView":142
11835  * format = format.encode('ASCII')
11836  * self._format = format # keep a reference to the byte string
11837  * self.format = self._format # <<<<<<<<<<<<<<
11838  *
11839  *
11840  */
11841  __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
11842  if (unlikely(__pyx_v_self->_format == Py_None)) {
11843  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
11844  __PYX_ERR(1, 142, __pyx_L1_error)
11845  }
11846  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
11847  __pyx_v_self->format = __pyx_t_7;
11848 
11849  /* "View.MemoryView":145
11850  *
11851  *
11852  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
11853  * self._strides = self._shape + self.ndim
11854  *
11855  */
11856  __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
11857  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
11858 
11859  /* "View.MemoryView":146
11860  *
11861  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
11862  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
11863  *
11864  * if not self._shape:
11865  */
11866  __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
11867  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
11868 
11869  /* "View.MemoryView":148
11870  * self._strides = self._shape + self.ndim
11871  *
11872  * if not self._shape: # <<<<<<<<<<<<<<
11873  * raise MemoryError("unable to allocate shape and strides.")
11874  *
11875  */
11876  __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
11877  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
11878  if (unlikely(__pyx_t_4)) {
11879 
11880  /* "View.MemoryView":149
11881  *
11882  * if not self._shape:
11883  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
11884  *
11885  *
11886  */
11887  __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
11888  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
11889  __Pyx_GOTREF(__pyx_t_3);
11890  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11891  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11892  __PYX_ERR(1, 149, __pyx_L1_error)
11893 
11894  /* "View.MemoryView":148
11895  * self._strides = self._shape + self.ndim
11896  *
11897  * if not self._shape: # <<<<<<<<<<<<<<
11898  * raise MemoryError("unable to allocate shape and strides.")
11899  *
11900  */
11901  }
11902 
11903  /* "View.MemoryView":152
11904  *
11905  *
11906  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
11907  * if dim <= 0:
11908  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11909  */
11910  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
11911  __pyx_t_8 = 0;
11912  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
11913  for (;;) {
11914  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
11915  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11916  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
11917  #else
11918  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
11919  __Pyx_GOTREF(__pyx_t_5);
11920  #endif
11921  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
11922  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11923  __pyx_v_dim = __pyx_t_9;
11924  __pyx_v_idx = __pyx_t_8;
11925  __pyx_t_8 = (__pyx_t_8 + 1);
11926 
11927  /* "View.MemoryView":153
11928  *
11929  * for idx, dim in enumerate(shape):
11930  * if dim <= 0: # <<<<<<<<<<<<<<
11931  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11932  * self._shape[idx] = dim
11933  */
11934  __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
11935  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
11936  if (unlikely(__pyx_t_4)) {
11937 
11938  /* "View.MemoryView":154
11939  * for idx, dim in enumerate(shape):
11940  * if dim <= 0:
11941  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
11942  * self._shape[idx] = dim
11943  *
11944  */
11945  __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
11946  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
11947  __Pyx_GOTREF(__pyx_t_5);
11948  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
11949  __Pyx_GOTREF(__pyx_t_6);
11950  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
11951  __Pyx_GOTREF(__pyx_t_10);
11952  __Pyx_GIVEREF(__pyx_t_5);
11953  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
11954  __Pyx_GIVEREF(__pyx_t_6);
11955  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
11956  __pyx_t_5 = 0;
11957  __pyx_t_6 = 0;
11958  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
11959  __Pyx_GOTREF(__pyx_t_6);
11960  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11961  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
11962  __Pyx_GOTREF(__pyx_t_10);
11963  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11964  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11965  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11966  __PYX_ERR(1, 154, __pyx_L1_error)
11967 
11968  /* "View.MemoryView":153
11969  *
11970  * for idx, dim in enumerate(shape):
11971  * if dim <= 0: # <<<<<<<<<<<<<<
11972  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11973  * self._shape[idx] = dim
11974  */
11975  }
11976 
11977  /* "View.MemoryView":155
11978  * if dim <= 0:
11979  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11980  * self._shape[idx] = dim # <<<<<<<<<<<<<<
11981  *
11982  * cdef char order
11983  */
11984  __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
11985  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
11986 
11987  /* "View.MemoryView":152
11988  *
11989  *
11990  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
11991  * if dim <= 0:
11992  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11993  */
11994  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
11995  }
11996  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11997 
11998  /* "View.MemoryView":158
11999  *
12000  * cdef char order
12001  * if mode == 'fortran': # <<<<<<<<<<<<<<
12002  * order = b'F'
12003  * self.mode = u'fortran'
12004  */
12005  __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
12006  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
12007  if (__pyx_t_4) {
12008 
12009  /* "View.MemoryView":159
12010  * cdef char order
12011  * if mode == 'fortran':
12012  * order = b'F' # <<<<<<<<<<<<<<
12013  * self.mode = u'fortran'
12014  * elif mode == 'c':
12015  */
12016  __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
12017  __pyx_v_order = 'F';
12018 
12019  /* "View.MemoryView":160
12020  * if mode == 'fortran':
12021  * order = b'F'
12022  * self.mode = u'fortran' # <<<<<<<<<<<<<<
12023  * elif mode == 'c':
12024  * order = b'C'
12025  */
12026  __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
12027  __Pyx_INCREF(__pyx_n_u_fortran);
12028  __Pyx_GIVEREF(__pyx_n_u_fortran);
12029  __Pyx_GOTREF(__pyx_v_self->mode);
12030  __Pyx_DECREF(__pyx_v_self->mode);
12031  __pyx_v_self->mode = __pyx_n_u_fortran;
12032 
12033  /* "View.MemoryView":158
12034  *
12035  * cdef char order
12036  * if mode == 'fortran': # <<<<<<<<<<<<<<
12037  * order = b'F'
12038  * self.mode = u'fortran'
12039  */
12040  goto __pyx_L10;
12041  }
12042 
12043  /* "View.MemoryView":161
12044  * order = b'F'
12045  * self.mode = u'fortran'
12046  * elif mode == 'c': # <<<<<<<<<<<<<<
12047  * order = b'C'
12048  * self.mode = u'c'
12049  */
12050  __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
12051  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
12052  if (likely(__pyx_t_4)) {
12053 
12054  /* "View.MemoryView":162
12055  * self.mode = u'fortran'
12056  * elif mode == 'c':
12057  * order = b'C' # <<<<<<<<<<<<<<
12058  * self.mode = u'c'
12059  * else:
12060  */
12061  __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
12062  __pyx_v_order = 'C';
12063 
12064  /* "View.MemoryView":163
12065  * elif mode == 'c':
12066  * order = b'C'
12067  * self.mode = u'c' # <<<<<<<<<<<<<<
12068  * else:
12069  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
12070  */
12071  __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
12072  __Pyx_INCREF(__pyx_n_u_c);
12073  __Pyx_GIVEREF(__pyx_n_u_c);
12074  __Pyx_GOTREF(__pyx_v_self->mode);
12075  __Pyx_DECREF(__pyx_v_self->mode);
12076  __pyx_v_self->mode = __pyx_n_u_c;
12077 
12078  /* "View.MemoryView":161
12079  * order = b'F'
12080  * self.mode = u'fortran'
12081  * elif mode == 'c': # <<<<<<<<<<<<<<
12082  * order = b'C'
12083  * self.mode = u'c'
12084  */
12085  goto __pyx_L10;
12086  }
12087 
12088  /* "View.MemoryView":165
12089  * self.mode = u'c'
12090  * else:
12091  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
12092  *
12093  * self.len = fill_contig_strides_array(self._shape, self._strides,
12094  */
12095  __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
12096  /*else*/ {
12097  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
12098  __Pyx_GOTREF(__pyx_t_3);
12099  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
12100  __Pyx_GOTREF(__pyx_t_10);
12101  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12102  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
12103  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12104  __PYX_ERR(1, 165, __pyx_L1_error)
12105  }
12106  __pyx_L10:;
12107 
12108  /* "View.MemoryView":167
12109  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
12110  *
12111  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
12112  * itemsize, self.ndim, order)
12113  *
12114  */
12115  __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
12116  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
12117 
12118  /* "View.MemoryView":170
12119  * itemsize, self.ndim, order)
12120  *
12121  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
12122  * self.dtype_is_object = format == b'O'
12123  * if allocate_buffer:
12124  */
12125  __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
12126  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
12127 
12128  /* "View.MemoryView":171
12129  *
12130  * self.free_data = allocate_buffer
12131  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
12132  * if allocate_buffer:
12133  *
12134  */
12135  __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
12136  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
12137  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
12138  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12139  __pyx_v_self->dtype_is_object = __pyx_t_4;
12140 
12141  /* "View.MemoryView":172
12142  * self.free_data = allocate_buffer
12143  * self.dtype_is_object = format == b'O'
12144  * if allocate_buffer: # <<<<<<<<<<<<<<
12145  *
12146  *
12147  */
12148  __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
12149  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
12150  if (__pyx_t_4) {
12151 
12152  /* "View.MemoryView":175
12153  *
12154  *
12155  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
12156  * if not self.data:
12157  * raise MemoryError("unable to allocate array data.")
12158  */
12159  __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
12160  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
12161 
12162  /* "View.MemoryView":176
12163  *
12164  * self.data = <char *>malloc(self.len)
12165  * if not self.data: # <<<<<<<<<<<<<<
12166  * raise MemoryError("unable to allocate array data.")
12167  *
12168  */
12169  __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
12170  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
12171  if (unlikely(__pyx_t_4)) {
12172 
12173  /* "View.MemoryView":177
12174  * self.data = <char *>malloc(self.len)
12175  * if not self.data:
12176  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
12177  *
12178  * if self.dtype_is_object:
12179  */
12180  __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
12181  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
12182  __Pyx_GOTREF(__pyx_t_10);
12183  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
12184  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12185  __PYX_ERR(1, 177, __pyx_L1_error)
12186 
12187  /* "View.MemoryView":176
12188  *
12189  * self.data = <char *>malloc(self.len)
12190  * if not self.data: # <<<<<<<<<<<<<<
12191  * raise MemoryError("unable to allocate array data.")
12192  *
12193  */
12194  }
12195 
12196  /* "View.MemoryView":179
12197  * raise MemoryError("unable to allocate array data.")
12198  *
12199  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12200  * p = <PyObject **> self.data
12201  * for i in range(self.len / itemsize):
12202  */
12203  __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
12204  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
12205  if (__pyx_t_4) {
12206 
12207  /* "View.MemoryView":180
12208  *
12209  * if self.dtype_is_object:
12210  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
12211  * for i in range(self.len / itemsize):
12212  * p[i] = Py_None
12213  */
12214  __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
12215  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
12216 
12217  /* "View.MemoryView":181
12218  * if self.dtype_is_object:
12219  * p = <PyObject **> self.data
12220  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
12221  * p[i] = Py_None
12222  * Py_INCREF(Py_None)
12223  */
12224  __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
12225  if (unlikely(__pyx_v_itemsize == 0)) {
12226  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
12227  __PYX_ERR(1, 181, __pyx_L1_error)
12228  }
12229  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
12230  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
12231  __PYX_ERR(1, 181, __pyx_L1_error)
12232  }
12233  __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
12234  __pyx_t_9 = __pyx_t_1;
12235  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
12236  __pyx_v_i = __pyx_t_11;
12237 
12238  /* "View.MemoryView":182
12239  * p = <PyObject **> self.data
12240  * for i in range(self.len / itemsize):
12241  * p[i] = Py_None # <<<<<<<<<<<<<<
12242  * Py_INCREF(Py_None)
12243  *
12244  */
12245  __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
12246  (__pyx_v_p[__pyx_v_i]) = Py_None;
12247 
12248  /* "View.MemoryView":183
12249  * for i in range(self.len / itemsize):
12250  * p[i] = Py_None
12251  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
12252  *
12253  * @cname('getbuffer')
12254  */
12255  __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
12256  Py_INCREF(Py_None);
12257  }
12258 
12259  /* "View.MemoryView":179
12260  * raise MemoryError("unable to allocate array data.")
12261  *
12262  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12263  * p = <PyObject **> self.data
12264  * for i in range(self.len / itemsize):
12265  */
12266  }
12267 
12268  /* "View.MemoryView":172
12269  * self.free_data = allocate_buffer
12270  * self.dtype_is_object = format == b'O'
12271  * if allocate_buffer: # <<<<<<<<<<<<<<
12272  *
12273  *
12274  */
12275  }
12276 
12277  /* "View.MemoryView":123
12278  * cdef bint dtype_is_object
12279  *
12280  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
12281  * mode="c", bint allocate_buffer=True):
12282  *
12283  */
12284 
12285  /* function exit code */
12286  __pyx_r = 0;
12287  goto __pyx_L0;
12288  __pyx_L1_error:;
12289  __Pyx_XDECREF(__pyx_t_3);
12290  __Pyx_XDECREF(__pyx_t_5);
12291  __Pyx_XDECREF(__pyx_t_6);
12292  __Pyx_XDECREF(__pyx_t_10);
12293  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12294  __pyx_r = -1;
12295  __pyx_L0:;
12296  __Pyx_XDECREF(__pyx_v_format);
12297  __Pyx_TraceReturn(Py_None, 0);
12298  __Pyx_RefNannyFinishContext();
12299  return __pyx_r;
12300 }
12301 
12302 /* "View.MemoryView":186
12303  *
12304  * @cname('getbuffer')
12305  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12306  * cdef int bufmode = -1
12307  * if self.mode == u"c":
12308  */
12309 
12310 /* Python wrapper */
12311 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12312 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12313  int __pyx_r;
12314  __Pyx_RefNannyDeclarations
12315  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12316  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12317 
12318  /* function exit code */
12319  __Pyx_RefNannyFinishContext();
12320  return __pyx_r;
12321 }
12322 
12323 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12324  int __pyx_v_bufmode;
12325  int __pyx_r;
12326  __Pyx_TraceDeclarations
12327  __Pyx_RefNannyDeclarations
12328  int __pyx_t_1;
12329  int __pyx_t_2;
12330  PyObject *__pyx_t_3 = NULL;
12331  char *__pyx_t_4;
12332  Py_ssize_t __pyx_t_5;
12333  int __pyx_t_6;
12334  Py_ssize_t *__pyx_t_7;
12335  int __pyx_lineno = 0;
12336  const char *__pyx_filename = NULL;
12337  int __pyx_clineno = 0;
12338  if (__pyx_v_info == NULL) {
12339  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12340  return -1;
12341  }
12342  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12343  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12344  __Pyx_GIVEREF(__pyx_v_info->obj);
12345  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
12346 
12347  /* "View.MemoryView":187
12348  * @cname('getbuffer')
12349  * def __getbuffer__(self, Py_buffer *info, int flags):
12350  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
12351  * if self.mode == u"c":
12352  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12353  */
12354  __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
12355  __pyx_v_bufmode = -1;
12356 
12357  /* "View.MemoryView":188
12358  * def __getbuffer__(self, Py_buffer *info, int flags):
12359  * cdef int bufmode = -1
12360  * if self.mode == u"c": # <<<<<<<<<<<<<<
12361  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12362  * elif self.mode == u"fortran":
12363  */
12364  __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
12365  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
12366  __pyx_t_2 = (__pyx_t_1 != 0);
12367  if (__pyx_t_2) {
12368 
12369  /* "View.MemoryView":189
12370  * cdef int bufmode = -1
12371  * if self.mode == u"c":
12372  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
12373  * elif self.mode == u"fortran":
12374  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12375  */
12376  __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
12377  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12378 
12379  /* "View.MemoryView":188
12380  * def __getbuffer__(self, Py_buffer *info, int flags):
12381  * cdef int bufmode = -1
12382  * if self.mode == u"c": # <<<<<<<<<<<<<<
12383  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12384  * elif self.mode == u"fortran":
12385  */
12386  goto __pyx_L3;
12387  }
12388 
12389  /* "View.MemoryView":190
12390  * if self.mode == u"c":
12391  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12392  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
12393  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12394  * if not (flags & bufmode):
12395  */
12396  __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
12397  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
12398  __pyx_t_1 = (__pyx_t_2 != 0);
12399  if (__pyx_t_1) {
12400 
12401  /* "View.MemoryView":191
12402  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12403  * elif self.mode == u"fortran":
12404  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
12405  * if not (flags & bufmode):
12406  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12407  */
12408  __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
12409  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12410 
12411  /* "View.MemoryView":190
12412  * if self.mode == u"c":
12413  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12414  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
12415  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12416  * if not (flags & bufmode):
12417  */
12418  }
12419  __pyx_L3:;
12420 
12421  /* "View.MemoryView":192
12422  * elif self.mode == u"fortran":
12423  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12424  * if not (flags & bufmode): # <<<<<<<<<<<<<<
12425  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12426  * info.buf = self.data
12427  */
12428  __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
12429  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
12430  if (unlikely(__pyx_t_1)) {
12431 
12432  /* "View.MemoryView":193
12433  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12434  * if not (flags & bufmode):
12435  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
12436  * info.buf = self.data
12437  * info.len = self.len
12438  */
12439  __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
12440  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
12441  __Pyx_GOTREF(__pyx_t_3);
12442  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12443  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12444  __PYX_ERR(1, 193, __pyx_L1_error)
12445 
12446  /* "View.MemoryView":192
12447  * elif self.mode == u"fortran":
12448  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12449  * if not (flags & bufmode): # <<<<<<<<<<<<<<
12450  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12451  * info.buf = self.data
12452  */
12453  }
12454 
12455  /* "View.MemoryView":194
12456  * if not (flags & bufmode):
12457  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12458  * info.buf = self.data # <<<<<<<<<<<<<<
12459  * info.len = self.len
12460  * info.ndim = self.ndim
12461  */
12462  __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
12463  __pyx_t_4 = __pyx_v_self->data;
12464  __pyx_v_info->buf = __pyx_t_4;
12465 
12466  /* "View.MemoryView":195
12467  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12468  * info.buf = self.data
12469  * info.len = self.len # <<<<<<<<<<<<<<
12470  * info.ndim = self.ndim
12471  * info.shape = self._shape
12472  */
12473  __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
12474  __pyx_t_5 = __pyx_v_self->len;
12475  __pyx_v_info->len = __pyx_t_5;
12476 
12477  /* "View.MemoryView":196
12478  * info.buf = self.data
12479  * info.len = self.len
12480  * info.ndim = self.ndim # <<<<<<<<<<<<<<
12481  * info.shape = self._shape
12482  * info.strides = self._strides
12483  */
12484  __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
12485  __pyx_t_6 = __pyx_v_self->ndim;
12486  __pyx_v_info->ndim = __pyx_t_6;
12487 
12488  /* "View.MemoryView":197
12489  * info.len = self.len
12490  * info.ndim = self.ndim
12491  * info.shape = self._shape # <<<<<<<<<<<<<<
12492  * info.strides = self._strides
12493  * info.suboffsets = NULL
12494  */
12495  __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
12496  __pyx_t_7 = __pyx_v_self->_shape;
12497  __pyx_v_info->shape = __pyx_t_7;
12498 
12499  /* "View.MemoryView":198
12500  * info.ndim = self.ndim
12501  * info.shape = self._shape
12502  * info.strides = self._strides # <<<<<<<<<<<<<<
12503  * info.suboffsets = NULL
12504  * info.itemsize = self.itemsize
12505  */
12506  __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
12507  __pyx_t_7 = __pyx_v_self->_strides;
12508  __pyx_v_info->strides = __pyx_t_7;
12509 
12510  /* "View.MemoryView":199
12511  * info.shape = self._shape
12512  * info.strides = self._strides
12513  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12514  * info.itemsize = self.itemsize
12515  * info.readonly = 0
12516  */
12517  __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
12518  __pyx_v_info->suboffsets = NULL;
12519 
12520  /* "View.MemoryView":200
12521  * info.strides = self._strides
12522  * info.suboffsets = NULL
12523  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
12524  * info.readonly = 0
12525  *
12526  */
12527  __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
12528  __pyx_t_5 = __pyx_v_self->itemsize;
12529  __pyx_v_info->itemsize = __pyx_t_5;
12530 
12531  /* "View.MemoryView":201
12532  * info.suboffsets = NULL
12533  * info.itemsize = self.itemsize
12534  * info.readonly = 0 # <<<<<<<<<<<<<<
12535  *
12536  * if flags & PyBUF_FORMAT:
12537  */
12538  __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
12539  __pyx_v_info->readonly = 0;
12540 
12541  /* "View.MemoryView":203
12542  * info.readonly = 0
12543  *
12544  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12545  * info.format = self.format
12546  * else:
12547  */
12548  __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
12549  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12550  if (__pyx_t_1) {
12551 
12552  /* "View.MemoryView":204
12553  *
12554  * if flags & PyBUF_FORMAT:
12555  * info.format = self.format # <<<<<<<<<<<<<<
12556  * else:
12557  * info.format = NULL
12558  */
12559  __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
12560  __pyx_t_4 = __pyx_v_self->format;
12561  __pyx_v_info->format = __pyx_t_4;
12562 
12563  /* "View.MemoryView":203
12564  * info.readonly = 0
12565  *
12566  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12567  * info.format = self.format
12568  * else:
12569  */
12570  goto __pyx_L5;
12571  }
12572 
12573  /* "View.MemoryView":206
12574  * info.format = self.format
12575  * else:
12576  * info.format = NULL # <<<<<<<<<<<<<<
12577  *
12578  * info.obj = self
12579  */
12580  __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
12581  /*else*/ {
12582  __pyx_v_info->format = NULL;
12583  }
12584  __pyx_L5:;
12585 
12586  /* "View.MemoryView":208
12587  * info.format = NULL
12588  *
12589  * info.obj = self # <<<<<<<<<<<<<<
12590  *
12591  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
12592  */
12593  __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
12594  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12595  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12596  __Pyx_GOTREF(__pyx_v_info->obj);
12597  __Pyx_DECREF(__pyx_v_info->obj);
12598  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12599 
12600  /* "View.MemoryView":186
12601  *
12602  * @cname('getbuffer')
12603  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12604  * cdef int bufmode = -1
12605  * if self.mode == u"c":
12606  */
12607 
12608  /* function exit code */
12609  __pyx_r = 0;
12610  goto __pyx_L0;
12611  __pyx_L1_error:;
12612  __Pyx_XDECREF(__pyx_t_3);
12613  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12614  __pyx_r = -1;
12615  if (__pyx_v_info->obj != NULL) {
12616  __Pyx_GOTREF(__pyx_v_info->obj);
12617  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12618  }
12619  goto __pyx_L2;
12620  __pyx_L0:;
12621  if (__pyx_v_info->obj == Py_None) {
12622  __Pyx_GOTREF(__pyx_v_info->obj);
12623  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12624  }
12625  __pyx_L2:;
12626  __Pyx_TraceReturn(Py_None, 0);
12627  __Pyx_RefNannyFinishContext();
12628  return __pyx_r;
12629 }
12630 
12631 /* "View.MemoryView":212
12632  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
12633  *
12634  * def __dealloc__(array self): # <<<<<<<<<<<<<<
12635  * if self.callback_free_data != NULL:
12636  * self.callback_free_data(self.data)
12637  */
12638 
12639 /* Python wrapper */
12640 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
12641 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
12642  __Pyx_RefNannyDeclarations
12643  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
12644  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
12645 
12646  /* function exit code */
12647  __Pyx_RefNannyFinishContext();
12648 }
12649 
12650 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
12651  __Pyx_TraceDeclarations
12652  __Pyx_RefNannyDeclarations
12653  int __pyx_t_1;
12654  int __pyx_lineno = 0;
12655  const char *__pyx_filename = NULL;
12656  int __pyx_clineno = 0;
12657  __Pyx_RefNannySetupContext("__dealloc__", 0);
12658  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
12659 
12660  /* "View.MemoryView":213
12661  *
12662  * def __dealloc__(array self):
12663  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
12664  * self.callback_free_data(self.data)
12665  * elif self.free_data:
12666  */
12667  __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
12668  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
12669  if (__pyx_t_1) {
12670 
12671  /* "View.MemoryView":214
12672  * def __dealloc__(array self):
12673  * if self.callback_free_data != NULL:
12674  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
12675  * elif self.free_data:
12676  * if self.dtype_is_object:
12677  */
12678  __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
12679  __pyx_v_self->callback_free_data(__pyx_v_self->data);
12680 
12681  /* "View.MemoryView":213
12682  *
12683  * def __dealloc__(array self):
12684  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
12685  * self.callback_free_data(self.data)
12686  * elif self.free_data:
12687  */
12688  goto __pyx_L3;
12689  }
12690 
12691  /* "View.MemoryView":215
12692  * if self.callback_free_data != NULL:
12693  * self.callback_free_data(self.data)
12694  * elif self.free_data: # <<<<<<<<<<<<<<
12695  * if self.dtype_is_object:
12696  * refcount_objects_in_slice(self.data, self._shape,
12697  */
12698  __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
12699  __pyx_t_1 = (__pyx_v_self->free_data != 0);
12700  if (__pyx_t_1) {
12701 
12702  /* "View.MemoryView":216
12703  * self.callback_free_data(self.data)
12704  * elif self.free_data:
12705  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12706  * refcount_objects_in_slice(self.data, self._shape,
12707  * self._strides, self.ndim, False)
12708  */
12709  __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
12710  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12711  if (__pyx_t_1) {
12712 
12713  /* "View.MemoryView":217
12714  * elif self.free_data:
12715  * if self.dtype_is_object:
12716  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
12717  * self._strides, self.ndim, False)
12718  * free(self.data)
12719  */
12720  __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
12721  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
12722 
12723  /* "View.MemoryView":216
12724  * self.callback_free_data(self.data)
12725  * elif self.free_data:
12726  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12727  * refcount_objects_in_slice(self.data, self._shape,
12728  * self._strides, self.ndim, False)
12729  */
12730  }
12731 
12732  /* "View.MemoryView":219
12733  * refcount_objects_in_slice(self.data, self._shape,
12734  * self._strides, self.ndim, False)
12735  * free(self.data) # <<<<<<<<<<<<<<
12736  * PyObject_Free(self._shape)
12737  *
12738  */
12739  __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
12740  free(__pyx_v_self->data);
12741 
12742  /* "View.MemoryView":215
12743  * if self.callback_free_data != NULL:
12744  * self.callback_free_data(self.data)
12745  * elif self.free_data: # <<<<<<<<<<<<<<
12746  * if self.dtype_is_object:
12747  * refcount_objects_in_slice(self.data, self._shape,
12748  */
12749  }
12750  __pyx_L3:;
12751 
12752  /* "View.MemoryView":220
12753  * self._strides, self.ndim, False)
12754  * free(self.data)
12755  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
12756  *
12757  * @property
12758  */
12759  __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
12760  PyObject_Free(__pyx_v_self->_shape);
12761 
12762  /* "View.MemoryView":212
12763  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
12764  *
12765  * def __dealloc__(array self): # <<<<<<<<<<<<<<
12766  * if self.callback_free_data != NULL:
12767  * self.callback_free_data(self.data)
12768  */
12769 
12770  /* function exit code */
12771  goto __pyx_L0;
12772  __pyx_L1_error:;
12773  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
12774  __pyx_L0:;
12775  __Pyx_TraceReturn(Py_None, 0);
12776  __Pyx_RefNannyFinishContext();
12777 }
12778 
12779 /* "View.MemoryView":223
12780  *
12781  * @property
12782  * def memview(self): # <<<<<<<<<<<<<<
12783  * return self.get_memview()
12784  *
12785  */
12786 
12787 /* Python wrapper */
12788 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
12789 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
12790  PyObject *__pyx_r = 0;
12791  __Pyx_RefNannyDeclarations
12792  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12793  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
12794 
12795  /* function exit code */
12796  __Pyx_RefNannyFinishContext();
12797  return __pyx_r;
12798 }
12799 
12800 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
12801  PyObject *__pyx_r = NULL;
12802  __Pyx_TraceDeclarations
12803  __Pyx_RefNannyDeclarations
12804  PyObject *__pyx_t_1 = NULL;
12805  int __pyx_lineno = 0;
12806  const char *__pyx_filename = NULL;
12807  int __pyx_clineno = 0;
12808  __Pyx_RefNannySetupContext("__get__", 0);
12809  __Pyx_TraceCall("__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
12810 
12811  /* "View.MemoryView":224
12812  * @property
12813  * def memview(self):
12814  * return self.get_memview() # <<<<<<<<<<<<<<
12815  *
12816  * @cname('get_memview')
12817  */
12818  __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
12819  __Pyx_XDECREF(__pyx_r);
12820  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
12821  __Pyx_GOTREF(__pyx_t_1);
12822  __pyx_r = __pyx_t_1;
12823  __pyx_t_1 = 0;
12824  goto __pyx_L0;
12825 
12826  /* "View.MemoryView":223
12827  *
12828  * @property
12829  * def memview(self): # <<<<<<<<<<<<<<
12830  * return self.get_memview()
12831  *
12832  */
12833 
12834  /* function exit code */
12835  __pyx_L1_error:;
12836  __Pyx_XDECREF(__pyx_t_1);
12837  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12838  __pyx_r = NULL;
12839  __pyx_L0:;
12840  __Pyx_XGIVEREF(__pyx_r);
12841  __Pyx_TraceReturn(__pyx_r, 0);
12842  __Pyx_RefNannyFinishContext();
12843  return __pyx_r;
12844 }
12845 
12846 /* "View.MemoryView":227
12847  *
12848  * @cname('get_memview')
12849  * cdef get_memview(self): # <<<<<<<<<<<<<<
12850  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
12851  * return memoryview(self, flags, self.dtype_is_object)
12852  */
12853 
12854 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
12855  int __pyx_v_flags;
12856  PyObject *__pyx_r = NULL;
12857  __Pyx_TraceDeclarations
12858  __Pyx_RefNannyDeclarations
12859  PyObject *__pyx_t_1 = NULL;
12860  PyObject *__pyx_t_2 = NULL;
12861  PyObject *__pyx_t_3 = NULL;
12862  int __pyx_lineno = 0;
12863  const char *__pyx_filename = NULL;
12864  int __pyx_clineno = 0;
12865  __Pyx_RefNannySetupContext("get_memview", 0);
12866  __Pyx_TraceCall("get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
12867 
12868  /* "View.MemoryView":228
12869  * @cname('get_memview')
12870  * cdef get_memview(self):
12871  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
12872  * return memoryview(self, flags, self.dtype_is_object)
12873  *
12874  */
12875  __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
12876  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
12877 
12878  /* "View.MemoryView":229
12879  * cdef get_memview(self):
12880  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
12881  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
12882  *
12883  * def __len__(self):
12884  */
12885  __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
12886  __Pyx_XDECREF(__pyx_r);
12887  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
12888  __Pyx_GOTREF(__pyx_t_1);
12889  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
12890  __Pyx_GOTREF(__pyx_t_2);
12891  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
12892  __Pyx_GOTREF(__pyx_t_3);
12893  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12894  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12895  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
12896  __Pyx_GIVEREF(__pyx_t_1);
12897  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12898  __Pyx_GIVEREF(__pyx_t_2);
12899  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12900  __pyx_t_1 = 0;
12901  __pyx_t_2 = 0;
12902  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
12903  __Pyx_GOTREF(__pyx_t_2);
12904  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12905  __pyx_r = __pyx_t_2;
12906  __pyx_t_2 = 0;
12907  goto __pyx_L0;
12908 
12909  /* "View.MemoryView":227
12910  *
12911  * @cname('get_memview')
12912  * cdef get_memview(self): # <<<<<<<<<<<<<<
12913  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
12914  * return memoryview(self, flags, self.dtype_is_object)
12915  */
12916 
12917  /* function exit code */
12918  __pyx_L1_error:;
12919  __Pyx_XDECREF(__pyx_t_1);
12920  __Pyx_XDECREF(__pyx_t_2);
12921  __Pyx_XDECREF(__pyx_t_3);
12922  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
12923  __pyx_r = 0;
12924  __pyx_L0:;
12925  __Pyx_XGIVEREF(__pyx_r);
12926  __Pyx_TraceReturn(__pyx_r, 0);
12927  __Pyx_RefNannyFinishContext();
12928  return __pyx_r;
12929 }
12930 
12931 /* "View.MemoryView":231
12932  * return memoryview(self, flags, self.dtype_is_object)
12933  *
12934  * def __len__(self): # <<<<<<<<<<<<<<
12935  * return self._shape[0]
12936  *
12937  */
12938 
12939 /* Python wrapper */
12940 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
12941 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
12942  Py_ssize_t __pyx_r;
12943  __Pyx_RefNannyDeclarations
12944  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
12945  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
12946 
12947  /* function exit code */
12948  __Pyx_RefNannyFinishContext();
12949  return __pyx_r;
12950 }
12951 
12952 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
12953  Py_ssize_t __pyx_r;
12954  __Pyx_TraceDeclarations
12955  __Pyx_RefNannyDeclarations
12956  int __pyx_lineno = 0;
12957  const char *__pyx_filename = NULL;
12958  int __pyx_clineno = 0;
12959  __Pyx_RefNannySetupContext("__len__", 0);
12960  __Pyx_TraceCall("__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
12961 
12962  /* "View.MemoryView":232
12963  *
12964  * def __len__(self):
12965  * return self._shape[0] # <<<<<<<<<<<<<<
12966  *
12967  * def __getattr__(self, attr):
12968  */
12969  __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
12970  __pyx_r = (__pyx_v_self->_shape[0]);
12971  goto __pyx_L0;
12972 
12973  /* "View.MemoryView":231
12974  * return memoryview(self, flags, self.dtype_is_object)
12975  *
12976  * def __len__(self): # <<<<<<<<<<<<<<
12977  * return self._shape[0]
12978  *
12979  */
12980 
12981  /* function exit code */
12982  __pyx_L1_error:;
12983  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12984  __pyx_r = -1;
12985  __pyx_L0:;
12986  __Pyx_TraceReturn(Py_None, 0);
12987  __Pyx_RefNannyFinishContext();
12988  return __pyx_r;
12989 }
12990 
12991 /* "View.MemoryView":234
12992  * return self._shape[0]
12993  *
12994  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
12995  * return getattr(self.memview, attr)
12996  *
12997  */
12998 
12999 /* Python wrapper */
13000 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
13001 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
13002  PyObject *__pyx_r = 0;
13003  __Pyx_RefNannyDeclarations
13004  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
13005  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
13006 
13007  /* function exit code */
13008  __Pyx_RefNannyFinishContext();
13009  return __pyx_r;
13010 }
13011 
13012 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
13013  PyObject *__pyx_r = NULL;
13014  __Pyx_TraceDeclarations
13015  __Pyx_RefNannyDeclarations
13016  PyObject *__pyx_t_1 = NULL;
13017  PyObject *__pyx_t_2 = NULL;
13018  int __pyx_lineno = 0;
13019  const char *__pyx_filename = NULL;
13020  int __pyx_clineno = 0;
13021  __Pyx_RefNannySetupContext("__getattr__", 0);
13022  __Pyx_TraceCall("__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
13023 
13024  /* "View.MemoryView":235
13025  *
13026  * def __getattr__(self, attr):
13027  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
13028  *
13029  * def __getitem__(self, item):
13030  */
13031  __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
13032  __Pyx_XDECREF(__pyx_r);
13033  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
13034  __Pyx_GOTREF(__pyx_t_1);
13035  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
13036  __Pyx_GOTREF(__pyx_t_2);
13037  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13038  __pyx_r = __pyx_t_2;
13039  __pyx_t_2 = 0;
13040  goto __pyx_L0;
13041 
13042  /* "View.MemoryView":234
13043  * return self._shape[0]
13044  *
13045  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
13046  * return getattr(self.memview, attr)
13047  *
13048  */
13049 
13050  /* function exit code */
13051  __pyx_L1_error:;
13052  __Pyx_XDECREF(__pyx_t_1);
13053  __Pyx_XDECREF(__pyx_t_2);
13054  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13055  __pyx_r = NULL;
13056  __pyx_L0:;
13057  __Pyx_XGIVEREF(__pyx_r);
13058  __Pyx_TraceReturn(__pyx_r, 0);
13059  __Pyx_RefNannyFinishContext();
13060  return __pyx_r;
13061 }
13062 
13063 /* "View.MemoryView":237
13064  * return getattr(self.memview, attr)
13065  *
13066  * def __getitem__(self, item): # <<<<<<<<<<<<<<
13067  * return self.memview[item]
13068  *
13069  */
13070 
13071 /* Python wrapper */
13072 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
13073 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
13074  PyObject *__pyx_r = 0;
13075  __Pyx_RefNannyDeclarations
13076  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
13077  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
13078 
13079  /* function exit code */
13080  __Pyx_RefNannyFinishContext();
13081  return __pyx_r;
13082 }
13083 
13084 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
13085  PyObject *__pyx_r = NULL;
13086  __Pyx_TraceDeclarations
13087  __Pyx_RefNannyDeclarations
13088  PyObject *__pyx_t_1 = NULL;
13089  PyObject *__pyx_t_2 = NULL;
13090  int __pyx_lineno = 0;
13091  const char *__pyx_filename = NULL;
13092  int __pyx_clineno = 0;
13093  __Pyx_RefNannySetupContext("__getitem__", 0);
13094  __Pyx_TraceCall("__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
13095 
13096  /* "View.MemoryView":238
13097  *
13098  * def __getitem__(self, item):
13099  * return self.memview[item] # <<<<<<<<<<<<<<
13100  *
13101  * def __setitem__(self, item, value):
13102  */
13103  __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
13104  __Pyx_XDECREF(__pyx_r);
13105  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
13106  __Pyx_GOTREF(__pyx_t_1);
13107  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
13108  __Pyx_GOTREF(__pyx_t_2);
13109  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13110  __pyx_r = __pyx_t_2;
13111  __pyx_t_2 = 0;
13112  goto __pyx_L0;
13113 
13114  /* "View.MemoryView":237
13115  * return getattr(self.memview, attr)
13116  *
13117  * def __getitem__(self, item): # <<<<<<<<<<<<<<
13118  * return self.memview[item]
13119  *
13120  */
13121 
13122  /* function exit code */
13123  __pyx_L1_error:;
13124  __Pyx_XDECREF(__pyx_t_1);
13125  __Pyx_XDECREF(__pyx_t_2);
13126  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13127  __pyx_r = NULL;
13128  __pyx_L0:;
13129  __Pyx_XGIVEREF(__pyx_r);
13130  __Pyx_TraceReturn(__pyx_r, 0);
13131  __Pyx_RefNannyFinishContext();
13132  return __pyx_r;
13133 }
13134 
13135 /* "View.MemoryView":240
13136  * return self.memview[item]
13137  *
13138  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
13139  * self.memview[item] = value
13140  *
13141  */
13142 
13143 /* Python wrapper */
13144 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
13145 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
13146  int __pyx_r;
13147  __Pyx_RefNannyDeclarations
13148  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
13149  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
13150 
13151  /* function exit code */
13152  __Pyx_RefNannyFinishContext();
13153  return __pyx_r;
13154 }
13155 
13156 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
13157  int __pyx_r;
13158  __Pyx_TraceDeclarations
13159  __Pyx_RefNannyDeclarations
13160  PyObject *__pyx_t_1 = NULL;
13161  int __pyx_lineno = 0;
13162  const char *__pyx_filename = NULL;
13163  int __pyx_clineno = 0;
13164  __Pyx_RefNannySetupContext("__setitem__", 0);
13165  __Pyx_TraceCall("__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
13166 
13167  /* "View.MemoryView":241
13168  *
13169  * def __setitem__(self, item, value):
13170  * self.memview[item] = value # <<<<<<<<<<<<<<
13171  *
13172  *
13173  */
13174  __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
13175  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
13176  __Pyx_GOTREF(__pyx_t_1);
13177  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
13178  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13179 
13180  /* "View.MemoryView":240
13181  * return self.memview[item]
13182  *
13183  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
13184  * self.memview[item] = value
13185  *
13186  */
13187 
13188  /* function exit code */
13189  __pyx_r = 0;
13190  goto __pyx_L0;
13191  __pyx_L1_error:;
13192  __Pyx_XDECREF(__pyx_t_1);
13193  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13194  __pyx_r = -1;
13195  __pyx_L0:;
13196  __Pyx_TraceReturn(Py_None, 0);
13197  __Pyx_RefNannyFinishContext();
13198  return __pyx_r;
13199 }
13200 
13201 /* "(tree fragment)":1
13202  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13203  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13204  * def __setstate_cython__(self, __pyx_state):
13205  */
13206 
13207 /* Python wrapper */
13208 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13209 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
13210 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13211  PyObject *__pyx_r = 0;
13212  __Pyx_RefNannyDeclarations
13213  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13214  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
13215 
13216  /* function exit code */
13217  __Pyx_RefNannyFinishContext();
13218  return __pyx_r;
13219 }
13220 
13221 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
13222  PyObject *__pyx_r = NULL;
13223  __Pyx_TraceDeclarations
13224  __Pyx_RefNannyDeclarations
13225  PyObject *__pyx_t_1 = NULL;
13226  int __pyx_lineno = 0;
13227  const char *__pyx_filename = NULL;
13228  int __pyx_clineno = 0;
13229  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13230  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13231 
13232  /* "(tree fragment)":2
13233  * def __reduce_cython__(self):
13234  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13235  * def __setstate_cython__(self, __pyx_state):
13236  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13237  */
13238  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13239  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13240  __Pyx_GOTREF(__pyx_t_1);
13241  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13242  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13243  __PYX_ERR(1, 2, __pyx_L1_error)
13244 
13245  /* "(tree fragment)":1
13246  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13247  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13248  * def __setstate_cython__(self, __pyx_state):
13249  */
13250 
13251  /* function exit code */
13252  __pyx_L1_error:;
13253  __Pyx_XDECREF(__pyx_t_1);
13254  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13255  __pyx_r = NULL;
13256  __Pyx_XGIVEREF(__pyx_r);
13257  __Pyx_TraceReturn(__pyx_r, 0);
13258  __Pyx_RefNannyFinishContext();
13259  return __pyx_r;
13260 }
13261 
13262 /* "(tree fragment)":3
13263  * def __reduce_cython__(self):
13264  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13265  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13266  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13267  */
13268 
13269 /* Python wrapper */
13270 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
13271 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
13272 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13273  PyObject *__pyx_r = 0;
13274  __Pyx_RefNannyDeclarations
13275  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13276  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13277 
13278  /* function exit code */
13279  __Pyx_RefNannyFinishContext();
13280  return __pyx_r;
13281 }
13282 
13283 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13284  PyObject *__pyx_r = NULL;
13285  __Pyx_TraceDeclarations
13286  __Pyx_RefNannyDeclarations
13287  PyObject *__pyx_t_1 = NULL;
13288  int __pyx_lineno = 0;
13289  const char *__pyx_filename = NULL;
13290  int __pyx_clineno = 0;
13291  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13292  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
13293 
13294  /* "(tree fragment)":4
13295  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13296  * def __setstate_cython__(self, __pyx_state):
13297  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13298  */
13299  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
13300  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13301  __Pyx_GOTREF(__pyx_t_1);
13302  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13303  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13304  __PYX_ERR(1, 4, __pyx_L1_error)
13305 
13306  /* "(tree fragment)":3
13307  * def __reduce_cython__(self):
13308  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13309  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13310  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13311  */
13312 
13313  /* function exit code */
13314  __pyx_L1_error:;
13315  __Pyx_XDECREF(__pyx_t_1);
13316  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13317  __pyx_r = NULL;
13318  __Pyx_XGIVEREF(__pyx_r);
13319  __Pyx_TraceReturn(__pyx_r, 0);
13320  __Pyx_RefNannyFinishContext();
13321  return __pyx_r;
13322 }
13323 
13324 /* "View.MemoryView":245
13325  *
13326  * @cname("__pyx_array_new")
13327  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
13328  * char *mode, char *buf):
13329  * cdef array result
13330  */
13331 
13332 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
13333  struct __pyx_array_obj *__pyx_v_result = 0;
13334  struct __pyx_array_obj *__pyx_r = NULL;
13335  __Pyx_TraceDeclarations
13336  __Pyx_RefNannyDeclarations
13337  int __pyx_t_1;
13338  PyObject *__pyx_t_2 = NULL;
13339  PyObject *__pyx_t_3 = NULL;
13340  PyObject *__pyx_t_4 = NULL;
13341  PyObject *__pyx_t_5 = NULL;
13342  int __pyx_lineno = 0;
13343  const char *__pyx_filename = NULL;
13344  int __pyx_clineno = 0;
13345  __Pyx_RefNannySetupContext("array_cwrapper", 0);
13346  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
13347 
13348  /* "View.MemoryView":249
13349  * cdef array result
13350  *
13351  * if buf == NULL: # <<<<<<<<<<<<<<
13352  * result = array(shape, itemsize, format, mode.decode('ASCII'))
13353  * else:
13354  */
13355  __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
13356  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
13357  if (__pyx_t_1) {
13358 
13359  /* "View.MemoryView":250
13360  *
13361  * if buf == NULL:
13362  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
13363  * else:
13364  * result = array(shape, itemsize, format, mode.decode('ASCII'),
13365  */
13366  __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
13367  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
13368  __Pyx_GOTREF(__pyx_t_2);
13369  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
13370  __Pyx_GOTREF(__pyx_t_3);
13371  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
13372  __Pyx_GOTREF(__pyx_t_4);
13373  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
13374  __Pyx_GOTREF(__pyx_t_5);
13375  __Pyx_INCREF(__pyx_v_shape);
13376  __Pyx_GIVEREF(__pyx_v_shape);
13377  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
13378  __Pyx_GIVEREF(__pyx_t_2);
13379  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
13380  __Pyx_GIVEREF(__pyx_t_3);
13381  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
13382  __Pyx_GIVEREF(__pyx_t_4);
13383  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
13384  __pyx_t_2 = 0;
13385  __pyx_t_3 = 0;
13386  __pyx_t_4 = 0;
13387  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
13388  __Pyx_GOTREF(__pyx_t_4);
13389  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13390  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
13391  __pyx_t_4 = 0;
13392 
13393  /* "View.MemoryView":249
13394  * cdef array result
13395  *
13396  * if buf == NULL: # <<<<<<<<<<<<<<
13397  * result = array(shape, itemsize, format, mode.decode('ASCII'))
13398  * else:
13399  */
13400  goto __pyx_L3;
13401  }
13402 
13403  /* "View.MemoryView":252
13404  * result = array(shape, itemsize, format, mode.decode('ASCII'))
13405  * else:
13406  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
13407  * allocate_buffer=False)
13408  * result.data = buf
13409  */
13410  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
13411  /*else*/ {
13412  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
13413  __Pyx_GOTREF(__pyx_t_4);
13414  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
13415  __Pyx_GOTREF(__pyx_t_5);
13416  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
13417  __Pyx_GOTREF(__pyx_t_3);
13418  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
13419  __Pyx_GOTREF(__pyx_t_2);
13420  __Pyx_INCREF(__pyx_v_shape);
13421  __Pyx_GIVEREF(__pyx_v_shape);
13422  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
13423  __Pyx_GIVEREF(__pyx_t_4);
13424  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
13425  __Pyx_GIVEREF(__pyx_t_5);
13426  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
13427  __Pyx_GIVEREF(__pyx_t_3);
13428  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
13429  __pyx_t_4 = 0;
13430  __pyx_t_5 = 0;
13431  __pyx_t_3 = 0;
13432 
13433  /* "View.MemoryView":253
13434  * else:
13435  * result = array(shape, itemsize, format, mode.decode('ASCII'),
13436  * allocate_buffer=False) # <<<<<<<<<<<<<<
13437  * result.data = buf
13438  *
13439  */
13440  __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
13441  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
13442  __Pyx_GOTREF(__pyx_t_3);
13443  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
13444 
13445  /* "View.MemoryView":252
13446  * result = array(shape, itemsize, format, mode.decode('ASCII'))
13447  * else:
13448  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
13449  * allocate_buffer=False)
13450  * result.data = buf
13451  */
13452  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
13453  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
13454  __Pyx_GOTREF(__pyx_t_5);
13455  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13456  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13457  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
13458  __pyx_t_5 = 0;
13459 
13460  /* "View.MemoryView":254
13461  * result = array(shape, itemsize, format, mode.decode('ASCII'),
13462  * allocate_buffer=False)
13463  * result.data = buf # <<<<<<<<<<<<<<
13464  *
13465  * return result
13466  */
13467  __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
13468  __pyx_v_result->data = __pyx_v_buf;
13469  }
13470  __pyx_L3:;
13471 
13472  /* "View.MemoryView":256
13473  * result.data = buf
13474  *
13475  * return result # <<<<<<<<<<<<<<
13476  *
13477  *
13478  */
13479  __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
13480  __Pyx_XDECREF(((PyObject *)__pyx_r));
13481  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13482  __pyx_r = __pyx_v_result;
13483  goto __pyx_L0;
13484 
13485  /* "View.MemoryView":245
13486  *
13487  * @cname("__pyx_array_new")
13488  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
13489  * char *mode, char *buf):
13490  * cdef array result
13491  */
13492 
13493  /* function exit code */
13494  __pyx_L1_error:;
13495  __Pyx_XDECREF(__pyx_t_2);
13496  __Pyx_XDECREF(__pyx_t_3);
13497  __Pyx_XDECREF(__pyx_t_4);
13498  __Pyx_XDECREF(__pyx_t_5);
13499  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13500  __pyx_r = 0;
13501  __pyx_L0:;
13502  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13503  __Pyx_XGIVEREF((PyObject *)__pyx_r);
13504  __Pyx_TraceReturn(__pyx_r, 0);
13505  __Pyx_RefNannyFinishContext();
13506  return __pyx_r;
13507 }
13508 
13509 /* "View.MemoryView":282
13510  * cdef class Enum(object):
13511  * cdef object name
13512  * def __init__(self, name): # <<<<<<<<<<<<<<
13513  * self.name = name
13514  * def __repr__(self):
13515  */
13516 
13517 /* Python wrapper */
13518 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13519 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13520  PyObject *__pyx_v_name = 0;
13521  int __pyx_lineno = 0;
13522  const char *__pyx_filename = NULL;
13523  int __pyx_clineno = 0;
13524  int __pyx_r;
13525  __Pyx_RefNannyDeclarations
13526  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
13527  {
13528  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
13529  PyObject* values[1] = {0};
13530  if (unlikely(__pyx_kwds)) {
13531  Py_ssize_t kw_args;
13532  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13533  switch (pos_args) {
13534  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13535  CYTHON_FALLTHROUGH;
13536  case 0: break;
13537  default: goto __pyx_L5_argtuple_error;
13538  }
13539  kw_args = PyDict_Size(__pyx_kwds);
13540  switch (pos_args) {
13541  case 0:
13542  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
13543  else goto __pyx_L5_argtuple_error;
13544  }
13545  if (unlikely(kw_args > 0)) {
13546  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
13547  }
13548  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
13549  goto __pyx_L5_argtuple_error;
13550  } else {
13551  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13552  }
13553  __pyx_v_name = values[0];
13554  }
13555  goto __pyx_L4_argument_unpacking_done;
13556  __pyx_L5_argtuple_error:;
13557  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
13558  __pyx_L3_error:;
13559  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13560  __Pyx_RefNannyFinishContext();
13561  return -1;
13562  __pyx_L4_argument_unpacking_done:;
13563  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
13564 
13565  /* function exit code */
13566  __Pyx_RefNannyFinishContext();
13567  return __pyx_r;
13568 }
13569 
13570 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
13571  int __pyx_r;
13572  __Pyx_TraceDeclarations
13573  __Pyx_RefNannyDeclarations
13574  int __pyx_lineno = 0;
13575  const char *__pyx_filename = NULL;
13576  int __pyx_clineno = 0;
13577  __Pyx_RefNannySetupContext("__init__", 0);
13578  __Pyx_TraceCall("__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
13579 
13580  /* "View.MemoryView":283
13581  * cdef object name
13582  * def __init__(self, name):
13583  * self.name = name # <<<<<<<<<<<<<<
13584  * def __repr__(self):
13585  * return self.name
13586  */
13587  __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
13588  __Pyx_INCREF(__pyx_v_name);
13589  __Pyx_GIVEREF(__pyx_v_name);
13590  __Pyx_GOTREF(__pyx_v_self->name);
13591  __Pyx_DECREF(__pyx_v_self->name);
13592  __pyx_v_self->name = __pyx_v_name;
13593 
13594  /* "View.MemoryView":282
13595  * cdef class Enum(object):
13596  * cdef object name
13597  * def __init__(self, name): # <<<<<<<<<<<<<<
13598  * self.name = name
13599  * def __repr__(self):
13600  */
13601 
13602  /* function exit code */
13603  __pyx_r = 0;
13604  goto __pyx_L0;
13605  __pyx_L1_error:;
13606  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13607  __pyx_r = -1;
13608  __pyx_L0:;
13609  __Pyx_TraceReturn(Py_None, 0);
13610  __Pyx_RefNannyFinishContext();
13611  return __pyx_r;
13612 }
13613 
13614 /* "View.MemoryView":284
13615  * def __init__(self, name):
13616  * self.name = name
13617  * def __repr__(self): # <<<<<<<<<<<<<<
13618  * return self.name
13619  *
13620  */
13621 
13622 /* Python wrapper */
13623 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
13624 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
13625  PyObject *__pyx_r = 0;
13626  __Pyx_RefNannyDeclarations
13627  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13628  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13629 
13630  /* function exit code */
13631  __Pyx_RefNannyFinishContext();
13632  return __pyx_r;
13633 }
13634 
13635 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13636  PyObject *__pyx_r = NULL;
13637  __Pyx_TraceDeclarations
13638  __Pyx_RefNannyDeclarations
13639  int __pyx_lineno = 0;
13640  const char *__pyx_filename = NULL;
13641  int __pyx_clineno = 0;
13642  __Pyx_RefNannySetupContext("__repr__", 0);
13643  __Pyx_TraceCall("__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
13644 
13645  /* "View.MemoryView":285
13646  * self.name = name
13647  * def __repr__(self):
13648  * return self.name # <<<<<<<<<<<<<<
13649  *
13650  * cdef generic = Enum("<strided and direct or indirect>")
13651  */
13652  __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
13653  __Pyx_XDECREF(__pyx_r);
13654  __Pyx_INCREF(__pyx_v_self->name);
13655  __pyx_r = __pyx_v_self->name;
13656  goto __pyx_L0;
13657 
13658  /* "View.MemoryView":284
13659  * def __init__(self, name):
13660  * self.name = name
13661  * def __repr__(self): # <<<<<<<<<<<<<<
13662  * return self.name
13663  *
13664  */
13665 
13666  /* function exit code */
13667  __pyx_L1_error:;
13668  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13669  __pyx_r = NULL;
13670  __pyx_L0:;
13671  __Pyx_XGIVEREF(__pyx_r);
13672  __Pyx_TraceReturn(__pyx_r, 0);
13673  __Pyx_RefNannyFinishContext();
13674  return __pyx_r;
13675 }
13676 
13677 /* "(tree fragment)":1
13678  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13679  * cdef tuple state
13680  * cdef object _dict
13681  */
13682 
13683 /* Python wrapper */
13684 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13685 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
13686 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13687  PyObject *__pyx_r = 0;
13688  __Pyx_RefNannyDeclarations
13689  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13690  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13691 
13692  /* function exit code */
13693  __Pyx_RefNannyFinishContext();
13694  return __pyx_r;
13695 }
13696 
13697 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13698  PyObject *__pyx_v_state = 0;
13699  PyObject *__pyx_v__dict = 0;
13700  int __pyx_v_use_setstate;
13701  PyObject *__pyx_r = NULL;
13702  __Pyx_TraceDeclarations
13703  __Pyx_RefNannyDeclarations
13704  PyObject *__pyx_t_1 = NULL;
13705  int __pyx_t_2;
13706  int __pyx_t_3;
13707  PyObject *__pyx_t_4 = NULL;
13708  PyObject *__pyx_t_5 = NULL;
13709  int __pyx_lineno = 0;
13710  const char *__pyx_filename = NULL;
13711  int __pyx_clineno = 0;
13712  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13713  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13714 
13715  /* "(tree fragment)":5
13716  * cdef object _dict
13717  * cdef bint use_setstate
13718  * state = (self.name,) # <<<<<<<<<<<<<<
13719  * _dict = getattr(self, '__dict__', None)
13720  * if _dict is not None:
13721  */
13722  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
13723  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
13724  __Pyx_GOTREF(__pyx_t_1);
13725  __Pyx_INCREF(__pyx_v_self->name);
13726  __Pyx_GIVEREF(__pyx_v_self->name);
13727  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
13728  __pyx_v_state = ((PyObject*)__pyx_t_1);
13729  __pyx_t_1 = 0;
13730 
13731  /* "(tree fragment)":6
13732  * cdef bint use_setstate
13733  * state = (self.name,)
13734  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
13735  * if _dict is not None:
13736  * state += (_dict,)
13737  */
13738  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
13739  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
13740  __Pyx_GOTREF(__pyx_t_1);
13741  __pyx_v__dict = __pyx_t_1;
13742  __pyx_t_1 = 0;
13743 
13744  /* "(tree fragment)":7
13745  * state = (self.name,)
13746  * _dict = getattr(self, '__dict__', None)
13747  * if _dict is not None: # <<<<<<<<<<<<<<
13748  * state += (_dict,)
13749  * use_setstate = True
13750  */
13751  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
13752  __pyx_t_2 = (__pyx_v__dict != Py_None);
13753  __pyx_t_3 = (__pyx_t_2 != 0);
13754  if (__pyx_t_3) {
13755 
13756  /* "(tree fragment)":8
13757  * _dict = getattr(self, '__dict__', None)
13758  * if _dict is not None:
13759  * state += (_dict,) # <<<<<<<<<<<<<<
13760  * use_setstate = True
13761  * else:
13762  */
13763  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
13764  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
13765  __Pyx_GOTREF(__pyx_t_1);
13766  __Pyx_INCREF(__pyx_v__dict);
13767  __Pyx_GIVEREF(__pyx_v__dict);
13768  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
13769  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
13770  __Pyx_GOTREF(__pyx_t_4);
13771  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13772  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
13773  __pyx_t_4 = 0;
13774 
13775  /* "(tree fragment)":9
13776  * if _dict is not None:
13777  * state += (_dict,)
13778  * use_setstate = True # <<<<<<<<<<<<<<
13779  * else:
13780  * use_setstate = self.name is not None
13781  */
13782  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
13783  __pyx_v_use_setstate = 1;
13784 
13785  /* "(tree fragment)":7
13786  * state = (self.name,)
13787  * _dict = getattr(self, '__dict__', None)
13788  * if _dict is not None: # <<<<<<<<<<<<<<
13789  * state += (_dict,)
13790  * use_setstate = True
13791  */
13792  goto __pyx_L3;
13793  }
13794 
13795  /* "(tree fragment)":11
13796  * use_setstate = True
13797  * else:
13798  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
13799  * if use_setstate:
13800  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13801  */
13802  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
13803  /*else*/ {
13804  __pyx_t_3 = (__pyx_v_self->name != Py_None);
13805  __pyx_v_use_setstate = __pyx_t_3;
13806  }
13807  __pyx_L3:;
13808 
13809  /* "(tree fragment)":12
13810  * else:
13811  * use_setstate = self.name is not None
13812  * if use_setstate: # <<<<<<<<<<<<<<
13813  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13814  * else:
13815  */
13816  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
13817  __pyx_t_3 = (__pyx_v_use_setstate != 0);
13818  if (__pyx_t_3) {
13819 
13820  /* "(tree fragment)":13
13821  * use_setstate = self.name is not None
13822  * if use_setstate:
13823  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
13824  * else:
13825  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13826  */
13827  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
13828  __Pyx_XDECREF(__pyx_r);
13829  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
13830  __Pyx_GOTREF(__pyx_t_4);
13831  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
13832  __Pyx_GOTREF(__pyx_t_1);
13833  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13834  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13835  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13836  __Pyx_INCREF(__pyx_int_184977713);
13837  __Pyx_GIVEREF(__pyx_int_184977713);
13838  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13839  __Pyx_INCREF(Py_None);
13840  __Pyx_GIVEREF(Py_None);
13841  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
13842  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
13843  __Pyx_GOTREF(__pyx_t_5);
13844  __Pyx_GIVEREF(__pyx_t_4);
13845  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13846  __Pyx_GIVEREF(__pyx_t_1);
13847  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
13848  __Pyx_INCREF(__pyx_v_state);
13849  __Pyx_GIVEREF(__pyx_v_state);
13850  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
13851  __pyx_t_4 = 0;
13852  __pyx_t_1 = 0;
13853  __pyx_r = __pyx_t_5;
13854  __pyx_t_5 = 0;
13855  goto __pyx_L0;
13856 
13857  /* "(tree fragment)":12
13858  * else:
13859  * use_setstate = self.name is not None
13860  * if use_setstate: # <<<<<<<<<<<<<<
13861  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13862  * else:
13863  */
13864  }
13865 
13866  /* "(tree fragment)":15
13867  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13868  * else:
13869  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
13870  * def __setstate_cython__(self, __pyx_state):
13871  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
13872  */
13873  __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
13874  /*else*/ {
13875  __Pyx_XDECREF(__pyx_r);
13876  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
13877  __Pyx_GOTREF(__pyx_t_5);
13878  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
13879  __Pyx_GOTREF(__pyx_t_1);
13880  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13881  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13882  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13883  __Pyx_INCREF(__pyx_int_184977713);
13884  __Pyx_GIVEREF(__pyx_int_184977713);
13885  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13886  __Pyx_INCREF(__pyx_v_state);
13887  __Pyx_GIVEREF(__pyx_v_state);
13888  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
13889  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
13890  __Pyx_GOTREF(__pyx_t_4);
13891  __Pyx_GIVEREF(__pyx_t_5);
13892  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
13893  __Pyx_GIVEREF(__pyx_t_1);
13894  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
13895  __pyx_t_5 = 0;
13896  __pyx_t_1 = 0;
13897  __pyx_r = __pyx_t_4;
13898  __pyx_t_4 = 0;
13899  goto __pyx_L0;
13900  }
13901 
13902  /* "(tree fragment)":1
13903  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13904  * cdef tuple state
13905  * cdef object _dict
13906  */
13907 
13908  /* function exit code */
13909  __pyx_L1_error:;
13910  __Pyx_XDECREF(__pyx_t_1);
13911  __Pyx_XDECREF(__pyx_t_4);
13912  __Pyx_XDECREF(__pyx_t_5);
13913  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13914  __pyx_r = NULL;
13915  __pyx_L0:;
13916  __Pyx_XDECREF(__pyx_v_state);
13917  __Pyx_XDECREF(__pyx_v__dict);
13918  __Pyx_XGIVEREF(__pyx_r);
13919  __Pyx_TraceReturn(__pyx_r, 0);
13920  __Pyx_RefNannyFinishContext();
13921  return __pyx_r;
13922 }
13923 
13924 /* "(tree fragment)":16
13925  * else:
13926  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13927  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13928  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
13929  */
13930 
13931 /* Python wrapper */
13932 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
13933 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
13934 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13935  PyObject *__pyx_r = 0;
13936  __Pyx_RefNannyDeclarations
13937  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13938  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13939 
13940  /* function exit code */
13941  __Pyx_RefNannyFinishContext();
13942  return __pyx_r;
13943 }
13944 
13945 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13946  PyObject *__pyx_r = NULL;
13947  __Pyx_TraceDeclarations
13948  __Pyx_RefNannyDeclarations
13949  PyObject *__pyx_t_1 = NULL;
13950  int __pyx_lineno = 0;
13951  const char *__pyx_filename = NULL;
13952  int __pyx_clineno = 0;
13953  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13954  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
13955 
13956  /* "(tree fragment)":17
13957  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13958  * def __setstate_cython__(self, __pyx_state):
13959  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
13960  */
13961  __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
13962  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
13963  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
13964  __Pyx_GOTREF(__pyx_t_1);
13965  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13966 
13967  /* "(tree fragment)":16
13968  * else:
13969  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13970  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13971  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
13972  */
13973 
13974  /* function exit code */
13975  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13976  goto __pyx_L0;
13977  __pyx_L1_error:;
13978  __Pyx_XDECREF(__pyx_t_1);
13979  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13980  __pyx_r = NULL;
13981  __pyx_L0:;
13982  __Pyx_XGIVEREF(__pyx_r);
13983  __Pyx_TraceReturn(__pyx_r, 0);
13984  __Pyx_RefNannyFinishContext();
13985  return __pyx_r;
13986 }
13987 
13988 /* "View.MemoryView":299
13989  *
13990  * @cname('__pyx_align_pointer')
13991  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
13992  * "Align pointer memory on a given boundary"
13993  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
13994  */
13995 
13996 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
13997  Py_intptr_t __pyx_v_aligned_p;
13998  size_t __pyx_v_offset;
13999  void *__pyx_r;
14000  __Pyx_TraceDeclarations
14001  int __pyx_t_1;
14002  int __pyx_lineno = 0;
14003  const char *__pyx_filename = NULL;
14004  int __pyx_clineno = 0;
14005  __Pyx_TraceCall("align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
14006 
14007  /* "View.MemoryView":301
14008  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
14009  * "Align pointer memory on a given boundary"
14010  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
14011  * cdef size_t offset
14012  *
14013  */
14014  __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
14015  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
14016 
14017  /* "View.MemoryView":305
14018  *
14019  * with cython.cdivision(True):
14020  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
14021  *
14022  * if offset > 0:
14023  */
14024  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
14025 
14026  /* "View.MemoryView":307
14027  * offset = aligned_p % alignment
14028  *
14029  * if offset > 0: # <<<<<<<<<<<<<<
14030  * aligned_p += alignment - offset
14031  *
14032  */
14033  __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
14034  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
14035  if (__pyx_t_1) {
14036 
14037  /* "View.MemoryView":308
14038  *
14039  * if offset > 0:
14040  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
14041  *
14042  * return <void *> aligned_p
14043  */
14044  __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
14045  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
14046 
14047  /* "View.MemoryView":307
14048  * offset = aligned_p % alignment
14049  *
14050  * if offset > 0: # <<<<<<<<<<<<<<
14051  * aligned_p += alignment - offset
14052  *
14053  */
14054  }
14055 
14056  /* "View.MemoryView":310
14057  * aligned_p += alignment - offset
14058  *
14059  * return <void *> aligned_p # <<<<<<<<<<<<<<
14060  *
14061  *
14062  */
14063  __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
14064  __pyx_r = ((void *)__pyx_v_aligned_p);
14065  goto __pyx_L0;
14066 
14067  /* "View.MemoryView":299
14068  *
14069  * @cname('__pyx_align_pointer')
14070  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
14071  * "Align pointer memory on a given boundary"
14072  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
14073  */
14074 
14075  /* function exit code */
14076  __pyx_L1_error:;
14077  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
14078  __pyx_r = 0;
14079  __pyx_L0:;
14080  __Pyx_TraceReturn(Py_None, 1);
14081  return __pyx_r;
14082 }
14083 
14084 /* "View.MemoryView":346
14085  * cdef __Pyx_TypeInfo *typeinfo
14086  *
14087  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
14088  * self.obj = obj
14089  * self.flags = flags
14090  */
14091 
14092 /* Python wrapper */
14093 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14094 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14095  PyObject *__pyx_v_obj = 0;
14096  int __pyx_v_flags;
14097  int __pyx_v_dtype_is_object;
14098  int __pyx_lineno = 0;
14099  const char *__pyx_filename = NULL;
14100  int __pyx_clineno = 0;
14101  int __pyx_r;
14102  __Pyx_RefNannyDeclarations
14103  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
14104  {
14105  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
14106  PyObject* values[3] = {0,0,0};
14107  if (unlikely(__pyx_kwds)) {
14108  Py_ssize_t kw_args;
14109  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14110  switch (pos_args) {
14111  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14112  CYTHON_FALLTHROUGH;
14113  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14114  CYTHON_FALLTHROUGH;
14115  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14116  CYTHON_FALLTHROUGH;
14117  case 0: break;
14118  default: goto __pyx_L5_argtuple_error;
14119  }
14120  kw_args = PyDict_Size(__pyx_kwds);
14121  switch (pos_args) {
14122  case 0:
14123  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
14124  else goto __pyx_L5_argtuple_error;
14125  CYTHON_FALLTHROUGH;
14126  case 1:
14127  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
14128  else {
14129  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
14130  }
14131  CYTHON_FALLTHROUGH;
14132  case 2:
14133  if (kw_args > 0) {
14134  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
14135  if (value) { values[2] = value; kw_args--; }
14136  }
14137  }
14138  if (unlikely(kw_args > 0)) {
14139  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
14140  }
14141  } else {
14142  switch (PyTuple_GET_SIZE(__pyx_args)) {
14143  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14144  CYTHON_FALLTHROUGH;
14145  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14146  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14147  break;
14148  default: goto __pyx_L5_argtuple_error;
14149  }
14150  }
14151  __pyx_v_obj = values[0];
14152  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
14153  if (values[2]) {
14154  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
14155  } else {
14156  __pyx_v_dtype_is_object = ((int)0);
14157  }
14158  }
14159  goto __pyx_L4_argument_unpacking_done;
14160  __pyx_L5_argtuple_error:;
14161  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
14162  __pyx_L3_error:;
14163  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14164  __Pyx_RefNannyFinishContext();
14165  return -1;
14166  __pyx_L4_argument_unpacking_done:;
14167  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
14168 
14169  /* function exit code */
14170  __Pyx_RefNannyFinishContext();
14171  return __pyx_r;
14172 }
14173 
14174 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
14175  int __pyx_r;
14176  __Pyx_TraceDeclarations
14177  __Pyx_RefNannyDeclarations
14178  int __pyx_t_1;
14179  int __pyx_t_2;
14180  int __pyx_t_3;
14181  int __pyx_t_4;
14182  int __pyx_lineno = 0;
14183  const char *__pyx_filename = NULL;
14184  int __pyx_clineno = 0;
14185  __Pyx_RefNannySetupContext("__cinit__", 0);
14186  __Pyx_TraceCall("__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
14187 
14188  /* "View.MemoryView":347
14189  *
14190  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
14191  * self.obj = obj # <<<<<<<<<<<<<<
14192  * self.flags = flags
14193  * if type(self) is memoryview or obj is not None:
14194  */
14195  __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
14196  __Pyx_INCREF(__pyx_v_obj);
14197  __Pyx_GIVEREF(__pyx_v_obj);
14198  __Pyx_GOTREF(__pyx_v_self->obj);
14199  __Pyx_DECREF(__pyx_v_self->obj);
14200  __pyx_v_self->obj = __pyx_v_obj;
14201 
14202  /* "View.MemoryView":348
14203  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
14204  * self.obj = obj
14205  * self.flags = flags # <<<<<<<<<<<<<<
14206  * if type(self) is memoryview or obj is not None:
14207  * __Pyx_GetBuffer(obj, &self.view, flags)
14208  */
14209  __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
14210  __pyx_v_self->flags = __pyx_v_flags;
14211 
14212  /* "View.MemoryView":349
14213  * self.obj = obj
14214  * self.flags = flags
14215  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
14216  * __Pyx_GetBuffer(obj, &self.view, flags)
14217  * if <PyObject *> self.view.obj == NULL:
14218  */
14219  __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
14220  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
14221  __pyx_t_3 = (__pyx_t_2 != 0);
14222  if (!__pyx_t_3) {
14223  } else {
14224  __pyx_t_1 = __pyx_t_3;
14225  goto __pyx_L4_bool_binop_done;
14226  }
14227  __pyx_t_3 = (__pyx_v_obj != Py_None);
14228  __pyx_t_2 = (__pyx_t_3 != 0);
14229  __pyx_t_1 = __pyx_t_2;
14230  __pyx_L4_bool_binop_done:;
14231  if (__pyx_t_1) {
14232 
14233  /* "View.MemoryView":350
14234  * self.flags = flags
14235  * if type(self) is memoryview or obj is not None:
14236  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
14237  * if <PyObject *> self.view.obj == NULL:
14238  * (<__pyx_buffer *> &self.view).obj = Py_None
14239  */
14240  __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
14241  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
14242 
14243  /* "View.MemoryView":351
14244  * if type(self) is memoryview or obj is not None:
14245  * __Pyx_GetBuffer(obj, &self.view, flags)
14246  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
14247  * (<__pyx_buffer *> &self.view).obj = Py_None
14248  * Py_INCREF(Py_None)
14249  */
14250  __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
14251  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
14252  if (__pyx_t_1) {
14253 
14254  /* "View.MemoryView":352
14255  * __Pyx_GetBuffer(obj, &self.view, flags)
14256  * if <PyObject *> self.view.obj == NULL:
14257  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
14258  * Py_INCREF(Py_None)
14259  *
14260  */
14261  __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
14262  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
14263 
14264  /* "View.MemoryView":353
14265  * if <PyObject *> self.view.obj == NULL:
14266  * (<__pyx_buffer *> &self.view).obj = Py_None
14267  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
14268  *
14269  * if not __PYX_CYTHON_ATOMICS_ENABLED():
14270  */
14271  __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
14272  Py_INCREF(Py_None);
14273 
14274  /* "View.MemoryView":351
14275  * if type(self) is memoryview or obj is not None:
14276  * __Pyx_GetBuffer(obj, &self.view, flags)
14277  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
14278  * (<__pyx_buffer *> &self.view).obj = Py_None
14279  * Py_INCREF(Py_None)
14280  */
14281  }
14282 
14283  /* "View.MemoryView":349
14284  * self.obj = obj
14285  * self.flags = flags
14286  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
14287  * __Pyx_GetBuffer(obj, &self.view, flags)
14288  * if <PyObject *> self.view.obj == NULL:
14289  */
14290  }
14291 
14292  /* "View.MemoryView":355
14293  * Py_INCREF(Py_None)
14294  *
14295  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
14296  * global __pyx_memoryview_thread_locks_used
14297  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
14298  */
14299  __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
14300  __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
14301  if (__pyx_t_1) {
14302 
14303  /* "View.MemoryView":357
14304  * if not __PYX_CYTHON_ATOMICS_ENABLED():
14305  * global __pyx_memoryview_thread_locks_used
14306  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
14307  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14308  * __pyx_memoryview_thread_locks_used += 1
14309  */
14310  __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
14311  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
14312  if (__pyx_t_1) {
14313 
14314  /* "View.MemoryView":358
14315  * global __pyx_memoryview_thread_locks_used
14316  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
14317  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
14318  * __pyx_memoryview_thread_locks_used += 1
14319  * if self.lock is NULL:
14320  */
14321  __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
14322  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
14323 
14324  /* "View.MemoryView":359
14325  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
14326  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14327  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
14328  * if self.lock is NULL:
14329  * self.lock = PyThread_allocate_lock()
14330  */
14331  __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
14332  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
14333 
14334  /* "View.MemoryView":357
14335  * if not __PYX_CYTHON_ATOMICS_ENABLED():
14336  * global __pyx_memoryview_thread_locks_used
14337  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
14338  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14339  * __pyx_memoryview_thread_locks_used += 1
14340  */
14341  }
14342 
14343  /* "View.MemoryView":360
14344  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14345  * __pyx_memoryview_thread_locks_used += 1
14346  * if self.lock is NULL: # <<<<<<<<<<<<<<
14347  * self.lock = PyThread_allocate_lock()
14348  * if self.lock is NULL:
14349  */
14350  __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
14351  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
14352  if (__pyx_t_1) {
14353 
14354  /* "View.MemoryView":361
14355  * __pyx_memoryview_thread_locks_used += 1
14356  * if self.lock is NULL:
14357  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
14358  * if self.lock is NULL:
14359  * raise MemoryError
14360  */
14361  __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
14362  __pyx_v_self->lock = PyThread_allocate_lock();
14363 
14364  /* "View.MemoryView":362
14365  * if self.lock is NULL:
14366  * self.lock = PyThread_allocate_lock()
14367  * if self.lock is NULL: # <<<<<<<<<<<<<<
14368  * raise MemoryError
14369  *
14370  */
14371  __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
14372  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
14373  if (unlikely(__pyx_t_1)) {
14374 
14375  /* "View.MemoryView":363
14376  * self.lock = PyThread_allocate_lock()
14377  * if self.lock is NULL:
14378  * raise MemoryError # <<<<<<<<<<<<<<
14379  *
14380  * if flags & PyBUF_FORMAT:
14381  */
14382  __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
14383  PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
14384 
14385  /* "View.MemoryView":362
14386  * if self.lock is NULL:
14387  * self.lock = PyThread_allocate_lock()
14388  * if self.lock is NULL: # <<<<<<<<<<<<<<
14389  * raise MemoryError
14390  *
14391  */
14392  }
14393 
14394  /* "View.MemoryView":360
14395  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14396  * __pyx_memoryview_thread_locks_used += 1
14397  * if self.lock is NULL: # <<<<<<<<<<<<<<
14398  * self.lock = PyThread_allocate_lock()
14399  * if self.lock is NULL:
14400  */
14401  }
14402 
14403  /* "View.MemoryView":355
14404  * Py_INCREF(Py_None)
14405  *
14406  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
14407  * global __pyx_memoryview_thread_locks_used
14408  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
14409  */
14410  }
14411 
14412  /* "View.MemoryView":365
14413  * raise MemoryError
14414  *
14415  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
14416  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
14417  * else:
14418  */
14419  __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
14420  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14421  if (__pyx_t_1) {
14422 
14423  /* "View.MemoryView":366
14424  *
14425  * if flags & PyBUF_FORMAT:
14426  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
14427  * else:
14428  * self.dtype_is_object = dtype_is_object
14429  */
14430  __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
14431  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
14432  if (__pyx_t_2) {
14433  } else {
14434  __pyx_t_1 = __pyx_t_2;
14435  goto __pyx_L12_bool_binop_done;
14436  }
14437  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
14438  __pyx_t_1 = __pyx_t_2;
14439  __pyx_L12_bool_binop_done:;
14440  __pyx_v_self->dtype_is_object = __pyx_t_1;
14441 
14442  /* "View.MemoryView":365
14443  * raise MemoryError
14444  *
14445  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
14446  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
14447  * else:
14448  */
14449  goto __pyx_L11;
14450  }
14451 
14452  /* "View.MemoryView":368
14453  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
14454  * else:
14455  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
14456  *
14457  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
14458  */
14459  __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
14460  /*else*/ {
14461  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
14462  }
14463  __pyx_L11:;
14464 
14465  /* "View.MemoryView":370
14466  * self.dtype_is_object = dtype_is_object
14467  *
14468  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
14469  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
14470  * self.typeinfo = NULL
14471  */
14472  __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
14473  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
14474 
14475  /* "View.MemoryView":372
14476  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
14477  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
14478  * self.typeinfo = NULL # <<<<<<<<<<<<<<
14479  *
14480  * def __dealloc__(memoryview self):
14481  */
14482  __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
14483  __pyx_v_self->typeinfo = NULL;
14484 
14485  /* "View.MemoryView":346
14486  * cdef __Pyx_TypeInfo *typeinfo
14487  *
14488  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
14489  * self.obj = obj
14490  * self.flags = flags
14491  */
14492 
14493  /* function exit code */
14494  __pyx_r = 0;
14495  goto __pyx_L0;
14496  __pyx_L1_error:;
14497  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14498  __pyx_r = -1;
14499  __pyx_L0:;
14500  __Pyx_TraceReturn(Py_None, 0);
14501  __Pyx_RefNannyFinishContext();
14502  return __pyx_r;
14503 }
14504 
14505 /* "View.MemoryView":374
14506  * self.typeinfo = NULL
14507  *
14508  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
14509  * if self.obj is not None:
14510  * __Pyx_ReleaseBuffer(&self.view)
14511  */
14512 
14513 /* Python wrapper */
14514 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
14515 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
14516  __Pyx_RefNannyDeclarations
14517  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14518  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14519 
14520  /* function exit code */
14521  __Pyx_RefNannyFinishContext();
14522 }
14523 
14524 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
14525  int __pyx_v_i;
14526  __Pyx_TraceDeclarations
14527  __Pyx_RefNannyDeclarations
14528  int __pyx_t_1;
14529  int __pyx_t_2;
14530  int __pyx_t_3;
14531  int __pyx_t_4;
14532  int __pyx_t_5;
14533  PyThread_type_lock __pyx_t_6;
14534  PyThread_type_lock __pyx_t_7;
14535  int __pyx_lineno = 0;
14536  const char *__pyx_filename = NULL;
14537  int __pyx_clineno = 0;
14538  __Pyx_RefNannySetupContext("__dealloc__", 0);
14539  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
14540 
14541  /* "View.MemoryView":375
14542  *
14543  * def __dealloc__(memoryview self):
14544  * if self.obj is not None: # <<<<<<<<<<<<<<
14545  * __Pyx_ReleaseBuffer(&self.view)
14546  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
14547  */
14548  __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
14549  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
14550  __pyx_t_2 = (__pyx_t_1 != 0);
14551  if (__pyx_t_2) {
14552 
14553  /* "View.MemoryView":376
14554  * def __dealloc__(memoryview self):
14555  * if self.obj is not None:
14556  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
14557  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
14558  *
14559  */
14560  __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
14561  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
14562 
14563  /* "View.MemoryView":375
14564  *
14565  * def __dealloc__(memoryview self):
14566  * if self.obj is not None: # <<<<<<<<<<<<<<
14567  * __Pyx_ReleaseBuffer(&self.view)
14568  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
14569  */
14570  goto __pyx_L3;
14571  }
14572 
14573  /* "View.MemoryView":377
14574  * if self.obj is not None:
14575  * __Pyx_ReleaseBuffer(&self.view)
14576  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
14577  *
14578  * (<__pyx_buffer *> &self.view).obj = NULL
14579  */
14580  __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
14581  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
14582  if (__pyx_t_2) {
14583 
14584  /* "View.MemoryView":379
14585  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
14586  *
14587  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
14588  * Py_DECREF(Py_None)
14589  *
14590  */
14591  __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
14592  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
14593 
14594  /* "View.MemoryView":380
14595  *
14596  * (<__pyx_buffer *> &self.view).obj = NULL
14597  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
14598  *
14599  * cdef int i
14600  */
14601  __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
14602  Py_DECREF(Py_None);
14603 
14604  /* "View.MemoryView":377
14605  * if self.obj is not None:
14606  * __Pyx_ReleaseBuffer(&self.view)
14607  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
14608  *
14609  * (<__pyx_buffer *> &self.view).obj = NULL
14610  */
14611  }
14612  __pyx_L3:;
14613 
14614  /* "View.MemoryView":384
14615  * cdef int i
14616  * global __pyx_memoryview_thread_locks_used
14617  * if self.lock != NULL: # <<<<<<<<<<<<<<
14618  * for i in range(__pyx_memoryview_thread_locks_used):
14619  * if __pyx_memoryview_thread_locks[i] is self.lock:
14620  */
14621  __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
14622  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
14623  if (__pyx_t_2) {
14624 
14625  /* "View.MemoryView":385
14626  * global __pyx_memoryview_thread_locks_used
14627  * if self.lock != NULL:
14628  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
14629  * if __pyx_memoryview_thread_locks[i] is self.lock:
14630  * __pyx_memoryview_thread_locks_used -= 1
14631  */
14632  __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
14633  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
14634  __pyx_t_4 = __pyx_t_3;
14635  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
14636  __pyx_v_i = __pyx_t_5;
14637 
14638  /* "View.MemoryView":386
14639  * if self.lock != NULL:
14640  * for i in range(__pyx_memoryview_thread_locks_used):
14641  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
14642  * __pyx_memoryview_thread_locks_used -= 1
14643  * if i != __pyx_memoryview_thread_locks_used:
14644  */
14645  __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
14646  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
14647  if (__pyx_t_2) {
14648 
14649  /* "View.MemoryView":387
14650  * for i in range(__pyx_memoryview_thread_locks_used):
14651  * if __pyx_memoryview_thread_locks[i] is self.lock:
14652  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
14653  * if i != __pyx_memoryview_thread_locks_used:
14654  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14655  */
14656  __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
14657  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
14658 
14659  /* "View.MemoryView":388
14660  * if __pyx_memoryview_thread_locks[i] is self.lock:
14661  * __pyx_memoryview_thread_locks_used -= 1
14662  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
14663  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14664  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14665  */
14666  __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
14667  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
14668  if (__pyx_t_2) {
14669 
14670  /* "View.MemoryView":390
14671  * if i != __pyx_memoryview_thread_locks_used:
14672  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14673  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
14674  * break
14675  * else:
14676  */
14677  __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
14678  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
14679  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
14680 
14681  /* "View.MemoryView":389
14682  * __pyx_memoryview_thread_locks_used -= 1
14683  * if i != __pyx_memoryview_thread_locks_used:
14684  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
14685  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14686  * break
14687  */
14688  __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
14689  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
14690  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
14691 
14692  /* "View.MemoryView":388
14693  * if __pyx_memoryview_thread_locks[i] is self.lock:
14694  * __pyx_memoryview_thread_locks_used -= 1
14695  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
14696  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14697  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14698  */
14699  }
14700 
14701  /* "View.MemoryView":391
14702  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14703  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14704  * break # <<<<<<<<<<<<<<
14705  * else:
14706  * PyThread_free_lock(self.lock)
14707  */
14708  __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
14709  goto __pyx_L6_break;
14710 
14711  /* "View.MemoryView":386
14712  * if self.lock != NULL:
14713  * for i in range(__pyx_memoryview_thread_locks_used):
14714  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
14715  * __pyx_memoryview_thread_locks_used -= 1
14716  * if i != __pyx_memoryview_thread_locks_used:
14717  */
14718  }
14719  }
14720  /*else*/ {
14721 
14722  /* "View.MemoryView":393
14723  * break
14724  * else:
14725  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
14726  *
14727  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
14728  */
14729  __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
14730  PyThread_free_lock(__pyx_v_self->lock);
14731  }
14732  __pyx_L6_break:;
14733 
14734  /* "View.MemoryView":384
14735  * cdef int i
14736  * global __pyx_memoryview_thread_locks_used
14737  * if self.lock != NULL: # <<<<<<<<<<<<<<
14738  * for i in range(__pyx_memoryview_thread_locks_used):
14739  * if __pyx_memoryview_thread_locks[i] is self.lock:
14740  */
14741  }
14742 
14743  /* "View.MemoryView":374
14744  * self.typeinfo = NULL
14745  *
14746  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
14747  * if self.obj is not None:
14748  * __Pyx_ReleaseBuffer(&self.view)
14749  */
14750 
14751  /* function exit code */
14752  goto __pyx_L0;
14753  __pyx_L1_error:;
14754  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14755  __pyx_L0:;
14756  __Pyx_TraceReturn(Py_None, 0);
14757  __Pyx_RefNannyFinishContext();
14758 }
14759 
14760 /* "View.MemoryView":395
14761  * PyThread_free_lock(self.lock)
14762  *
14763  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
14764  * cdef Py_ssize_t dim
14765  * cdef char *itemp = <char *> self.view.buf
14766  */
14767 
14768 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14769  Py_ssize_t __pyx_v_dim;
14770  char *__pyx_v_itemp;
14771  PyObject *__pyx_v_idx = NULL;
14772  char *__pyx_r;
14773  __Pyx_TraceDeclarations
14774  __Pyx_RefNannyDeclarations
14775  Py_ssize_t __pyx_t_1;
14776  PyObject *__pyx_t_2 = NULL;
14777  Py_ssize_t __pyx_t_3;
14778  PyObject *(*__pyx_t_4)(PyObject *);
14779  PyObject *__pyx_t_5 = NULL;
14780  Py_ssize_t __pyx_t_6;
14781  char *__pyx_t_7;
14782  int __pyx_lineno = 0;
14783  const char *__pyx_filename = NULL;
14784  int __pyx_clineno = 0;
14785  __Pyx_RefNannySetupContext("get_item_pointer", 0);
14786  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
14787 
14788  /* "View.MemoryView":397
14789  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
14790  * cdef Py_ssize_t dim
14791  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
14792  *
14793  * for dim, idx in enumerate(index):
14794  */
14795  __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
14796  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
14797 
14798  /* "View.MemoryView":399
14799  * cdef char *itemp = <char *> self.view.buf
14800  *
14801  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
14802  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
14803  *
14804  */
14805  __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
14806  __pyx_t_1 = 0;
14807  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
14808  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
14809  __pyx_t_4 = NULL;
14810  } else {
14811  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
14812  __Pyx_GOTREF(__pyx_t_2);
14813  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
14814  }
14815  for (;;) {
14816  if (likely(!__pyx_t_4)) {
14817  if (likely(PyList_CheckExact(__pyx_t_2))) {
14818  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
14819  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14820  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
14821  #else
14822  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
14823  __Pyx_GOTREF(__pyx_t_5);
14824  #endif
14825  } else {
14826  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
14827  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14828  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
14829  #else
14830  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
14831  __Pyx_GOTREF(__pyx_t_5);
14832  #endif
14833  }
14834  } else {
14835  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
14836  if (unlikely(!__pyx_t_5)) {
14837  PyObject* exc_type = PyErr_Occurred();
14838  if (exc_type) {
14839  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14840  else __PYX_ERR(1, 399, __pyx_L1_error)
14841  }
14842  break;
14843  }
14844  __Pyx_GOTREF(__pyx_t_5);
14845  }
14846  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
14847  __pyx_t_5 = 0;
14848  __pyx_v_dim = __pyx_t_1;
14849  __pyx_t_1 = (__pyx_t_1 + 1);
14850 
14851  /* "View.MemoryView":400
14852  *
14853  * for dim, idx in enumerate(index):
14854  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
14855  *
14856  * return itemp
14857  */
14858  __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
14859  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
14860  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
14861  __pyx_v_itemp = __pyx_t_7;
14862 
14863  /* "View.MemoryView":399
14864  * cdef char *itemp = <char *> self.view.buf
14865  *
14866  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
14867  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
14868  *
14869  */
14870  __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
14871  }
14872  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14873 
14874  /* "View.MemoryView":402
14875  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
14876  *
14877  * return itemp # <<<<<<<<<<<<<<
14878  *
14879  *
14880  */
14881  __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
14882  __pyx_r = __pyx_v_itemp;
14883  goto __pyx_L0;
14884 
14885  /* "View.MemoryView":395
14886  * PyThread_free_lock(self.lock)
14887  *
14888  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
14889  * cdef Py_ssize_t dim
14890  * cdef char *itemp = <char *> self.view.buf
14891  */
14892 
14893  /* function exit code */
14894  __pyx_L1_error:;
14895  __Pyx_XDECREF(__pyx_t_2);
14896  __Pyx_XDECREF(__pyx_t_5);
14897  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
14898  __pyx_r = NULL;
14899  __pyx_L0:;
14900  __Pyx_XDECREF(__pyx_v_idx);
14901  __Pyx_TraceReturn(Py_None, 0);
14902  __Pyx_RefNannyFinishContext();
14903  return __pyx_r;
14904 }
14905 
14906 /* "View.MemoryView":405
14907  *
14908  *
14909  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
14910  * if index is Ellipsis:
14911  * return self
14912  */
14913 
14914 /* Python wrapper */
14915 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
14916 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
14917  PyObject *__pyx_r = 0;
14918  __Pyx_RefNannyDeclarations
14919  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
14920  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
14921 
14922  /* function exit code */
14923  __Pyx_RefNannyFinishContext();
14924  return __pyx_r;
14925 }
14926 
14927 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14928  PyObject *__pyx_v_have_slices = NULL;
14929  PyObject *__pyx_v_indices = NULL;
14930  char *__pyx_v_itemp;
14931  PyObject *__pyx_r = NULL;
14932  __Pyx_TraceDeclarations
14933  __Pyx_RefNannyDeclarations
14934  int __pyx_t_1;
14935  int __pyx_t_2;
14936  PyObject *__pyx_t_3 = NULL;
14937  PyObject *__pyx_t_4 = NULL;
14938  PyObject *__pyx_t_5 = NULL;
14939  char *__pyx_t_6;
14940  int __pyx_lineno = 0;
14941  const char *__pyx_filename = NULL;
14942  int __pyx_clineno = 0;
14943  __Pyx_RefNannySetupContext("__getitem__", 0);
14944  __Pyx_TraceCall("__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
14945 
14946  /* "View.MemoryView":406
14947  *
14948  * def __getitem__(memoryview self, object index):
14949  * if index is Ellipsis: # <<<<<<<<<<<<<<
14950  * return self
14951  *
14952  */
14953  __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
14954  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
14955  __pyx_t_2 = (__pyx_t_1 != 0);
14956  if (__pyx_t_2) {
14957 
14958  /* "View.MemoryView":407
14959  * def __getitem__(memoryview self, object index):
14960  * if index is Ellipsis:
14961  * return self # <<<<<<<<<<<<<<
14962  *
14963  * have_slices, indices = _unellipsify(index, self.view.ndim)
14964  */
14965  __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
14966  __Pyx_XDECREF(__pyx_r);
14967  __Pyx_INCREF(((PyObject *)__pyx_v_self));
14968  __pyx_r = ((PyObject *)__pyx_v_self);
14969  goto __pyx_L0;
14970 
14971  /* "View.MemoryView":406
14972  *
14973  * def __getitem__(memoryview self, object index):
14974  * if index is Ellipsis: # <<<<<<<<<<<<<<
14975  * return self
14976  *
14977  */
14978  }
14979 
14980  /* "View.MemoryView":409
14981  * return self
14982  *
14983  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
14984  *
14985  * cdef char *itemp
14986  */
14987  __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
14988  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
14989  __Pyx_GOTREF(__pyx_t_3);
14990  if (likely(__pyx_t_3 != Py_None)) {
14991  PyObject* sequence = __pyx_t_3;
14992  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14993  if (unlikely(size != 2)) {
14994  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14995  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14996  __PYX_ERR(1, 409, __pyx_L1_error)
14997  }
14998  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14999  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
15000  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
15001  __Pyx_INCREF(__pyx_t_4);
15002  __Pyx_INCREF(__pyx_t_5);
15003  #else
15004  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
15005  __Pyx_GOTREF(__pyx_t_4);
15006  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
15007  __Pyx_GOTREF(__pyx_t_5);
15008  #endif
15009  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15010  } else {
15011  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
15012  }
15013  __pyx_v_have_slices = __pyx_t_4;
15014  __pyx_t_4 = 0;
15015  __pyx_v_indices = __pyx_t_5;
15016  __pyx_t_5 = 0;
15017 
15018  /* "View.MemoryView":412
15019  *
15020  * cdef char *itemp
15021  * if have_slices: # <<<<<<<<<<<<<<
15022  * return memview_slice(self, indices)
15023  * else:
15024  */
15025  __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
15026  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
15027  if (__pyx_t_2) {
15028 
15029  /* "View.MemoryView":413
15030  * cdef char *itemp
15031  * if have_slices:
15032  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
15033  * else:
15034  * itemp = self.get_item_pointer(indices)
15035  */
15036  __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
15037  __Pyx_XDECREF(__pyx_r);
15038  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
15039  __Pyx_GOTREF(__pyx_t_3);
15040  __pyx_r = __pyx_t_3;
15041  __pyx_t_3 = 0;
15042  goto __pyx_L0;
15043 
15044  /* "View.MemoryView":412
15045  *
15046  * cdef char *itemp
15047  * if have_slices: # <<<<<<<<<<<<<<
15048  * return memview_slice(self, indices)
15049  * else:
15050  */
15051  }
15052 
15053  /* "View.MemoryView":415
15054  * return memview_slice(self, indices)
15055  * else:
15056  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
15057  * return self.convert_item_to_object(itemp)
15058  *
15059  */
15060  __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
15061  /*else*/ {
15062  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
15063  __pyx_v_itemp = __pyx_t_6;
15064 
15065  /* "View.MemoryView":416
15066  * else:
15067  * itemp = self.get_item_pointer(indices)
15068  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
15069  *
15070  * def __setitem__(memoryview self, object index, object value):
15071  */
15072  __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
15073  __Pyx_XDECREF(__pyx_r);
15074  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
15075  __Pyx_GOTREF(__pyx_t_3);
15076  __pyx_r = __pyx_t_3;
15077  __pyx_t_3 = 0;
15078  goto __pyx_L0;
15079  }
15080 
15081  /* "View.MemoryView":405
15082  *
15083  *
15084  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
15085  * if index is Ellipsis:
15086  * return self
15087  */
15088 
15089  /* function exit code */
15090  __pyx_L1_error:;
15091  __Pyx_XDECREF(__pyx_t_3);
15092  __Pyx_XDECREF(__pyx_t_4);
15093  __Pyx_XDECREF(__pyx_t_5);
15094  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15095  __pyx_r = NULL;
15096  __pyx_L0:;
15097  __Pyx_XDECREF(__pyx_v_have_slices);
15098  __Pyx_XDECREF(__pyx_v_indices);
15099  __Pyx_XGIVEREF(__pyx_r);
15100  __Pyx_TraceReturn(__pyx_r, 0);
15101  __Pyx_RefNannyFinishContext();
15102  return __pyx_r;
15103 }
15104 
15105 /* "View.MemoryView":418
15106  * return self.convert_item_to_object(itemp)
15107  *
15108  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
15109  * if self.view.readonly:
15110  * raise TypeError("Cannot assign to read-only memoryview")
15111  */
15112 
15113 /* Python wrapper */
15114 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
15115 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
15116  int __pyx_r;
15117  __Pyx_RefNannyDeclarations
15118  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
15119  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
15120 
15121  /* function exit code */
15122  __Pyx_RefNannyFinishContext();
15123  return __pyx_r;
15124 }
15125 
15126 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
15127  PyObject *__pyx_v_have_slices = NULL;
15128  PyObject *__pyx_v_obj = NULL;
15129  int __pyx_r;
15130  __Pyx_TraceDeclarations
15131  __Pyx_RefNannyDeclarations
15132  int __pyx_t_1;
15133  PyObject *__pyx_t_2 = NULL;
15134  PyObject *__pyx_t_3 = NULL;
15135  PyObject *__pyx_t_4 = NULL;
15136  int __pyx_lineno = 0;
15137  const char *__pyx_filename = NULL;
15138  int __pyx_clineno = 0;
15139  __Pyx_RefNannySetupContext("__setitem__", 0);
15140  __Pyx_TraceCall("__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
15141  __Pyx_INCREF(__pyx_v_index);
15142 
15143  /* "View.MemoryView":419
15144  *
15145  * def __setitem__(memoryview self, object index, object value):
15146  * if self.view.readonly: # <<<<<<<<<<<<<<
15147  * raise TypeError("Cannot assign to read-only memoryview")
15148  *
15149  */
15150  __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
15151  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
15152  if (unlikely(__pyx_t_1)) {
15153 
15154  /* "View.MemoryView":420
15155  * def __setitem__(memoryview self, object index, object value):
15156  * if self.view.readonly:
15157  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
15158  *
15159  * have_slices, index = _unellipsify(index, self.view.ndim)
15160  */
15161  __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
15162  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
15163  __Pyx_GOTREF(__pyx_t_2);
15164  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
15165  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15166  __PYX_ERR(1, 420, __pyx_L1_error)
15167 
15168  /* "View.MemoryView":419
15169  *
15170  * def __setitem__(memoryview self, object index, object value):
15171  * if self.view.readonly: # <<<<<<<<<<<<<<
15172  * raise TypeError("Cannot assign to read-only memoryview")
15173  *
15174  */
15175  }
15176 
15177  /* "View.MemoryView":422
15178  * raise TypeError("Cannot assign to read-only memoryview")
15179  *
15180  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
15181  *
15182  * if have_slices:
15183  */
15184  __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
15185  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
15186  __Pyx_GOTREF(__pyx_t_2);
15187  if (likely(__pyx_t_2 != Py_None)) {
15188  PyObject* sequence = __pyx_t_2;
15189  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
15190  if (unlikely(size != 2)) {
15191  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
15192  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
15193  __PYX_ERR(1, 422, __pyx_L1_error)
15194  }
15195  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15196  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
15197  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
15198  __Pyx_INCREF(__pyx_t_3);
15199  __Pyx_INCREF(__pyx_t_4);
15200  #else
15201  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
15202  __Pyx_GOTREF(__pyx_t_3);
15203  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
15204  __Pyx_GOTREF(__pyx_t_4);
15205  #endif
15206  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15207  } else {
15208  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
15209  }
15210  __pyx_v_have_slices = __pyx_t_3;
15211  __pyx_t_3 = 0;
15212  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
15213  __pyx_t_4 = 0;
15214 
15215  /* "View.MemoryView":424
15216  * have_slices, index = _unellipsify(index, self.view.ndim)
15217  *
15218  * if have_slices: # <<<<<<<<<<<<<<
15219  * obj = self.is_slice(value)
15220  * if obj:
15221  */
15222  __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
15223  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
15224  if (__pyx_t_1) {
15225 
15226  /* "View.MemoryView":425
15227  *
15228  * if have_slices:
15229  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
15230  * if obj:
15231  * self.setitem_slice_assignment(self[index], obj)
15232  */
15233  __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
15234  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
15235  __Pyx_GOTREF(__pyx_t_2);
15236  __pyx_v_obj = __pyx_t_2;
15237  __pyx_t_2 = 0;
15238 
15239  /* "View.MemoryView":426
15240  * if have_slices:
15241  * obj = self.is_slice(value)
15242  * if obj: # <<<<<<<<<<<<<<
15243  * self.setitem_slice_assignment(self[index], obj)
15244  * else:
15245  */
15246  __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
15247  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
15248  if (__pyx_t_1) {
15249 
15250  /* "View.MemoryView":427
15251  * obj = self.is_slice(value)
15252  * if obj:
15253  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
15254  * else:
15255  * self.setitem_slice_assign_scalar(self[index], value)
15256  */
15257  __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
15258  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
15259  __Pyx_GOTREF(__pyx_t_2);
15260  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
15261  __Pyx_GOTREF(__pyx_t_4);
15262  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15263  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15264 
15265  /* "View.MemoryView":426
15266  * if have_slices:
15267  * obj = self.is_slice(value)
15268  * if obj: # <<<<<<<<<<<<<<
15269  * self.setitem_slice_assignment(self[index], obj)
15270  * else:
15271  */
15272  goto __pyx_L5;
15273  }
15274 
15275  /* "View.MemoryView":429
15276  * self.setitem_slice_assignment(self[index], obj)
15277  * else:
15278  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
15279  * else:
15280  * self.setitem_indexed(index, value)
15281  */
15282  __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
15283  /*else*/ {
15284  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
15285  __Pyx_GOTREF(__pyx_t_4);
15286  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
15287  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
15288  __Pyx_GOTREF(__pyx_t_2);
15289  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15290  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15291  }
15292  __pyx_L5:;
15293 
15294  /* "View.MemoryView":424
15295  * have_slices, index = _unellipsify(index, self.view.ndim)
15296  *
15297  * if have_slices: # <<<<<<<<<<<<<<
15298  * obj = self.is_slice(value)
15299  * if obj:
15300  */
15301  goto __pyx_L4;
15302  }
15303 
15304  /* "View.MemoryView":431
15305  * self.setitem_slice_assign_scalar(self[index], value)
15306  * else:
15307  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
15308  *
15309  * cdef is_slice(self, obj):
15310  */
15311  __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
15312  /*else*/ {
15313  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
15314  __Pyx_GOTREF(__pyx_t_2);
15315  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15316  }
15317  __pyx_L4:;
15318 
15319  /* "View.MemoryView":418
15320  * return self.convert_item_to_object(itemp)
15321  *
15322  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
15323  * if self.view.readonly:
15324  * raise TypeError("Cannot assign to read-only memoryview")
15325  */
15326 
15327  /* function exit code */
15328  __pyx_r = 0;
15329  goto __pyx_L0;
15330  __pyx_L1_error:;
15331  __Pyx_XDECREF(__pyx_t_2);
15332  __Pyx_XDECREF(__pyx_t_3);
15333  __Pyx_XDECREF(__pyx_t_4);
15334  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15335  __pyx_r = -1;
15336  __pyx_L0:;
15337  __Pyx_XDECREF(__pyx_v_have_slices);
15338  __Pyx_XDECREF(__pyx_v_obj);
15339  __Pyx_XDECREF(__pyx_v_index);
15340  __Pyx_TraceReturn(Py_None, 0);
15341  __Pyx_RefNannyFinishContext();
15342  return __pyx_r;
15343 }
15344 
15345 /* "View.MemoryView":433
15346  * self.setitem_indexed(index, value)
15347  *
15348  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
15349  * if not isinstance(obj, memoryview):
15350  * try:
15351  */
15352 
15353 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
15354  PyObject *__pyx_r = NULL;
15355  __Pyx_TraceDeclarations
15356  __Pyx_RefNannyDeclarations
15357  int __pyx_t_1;
15358  int __pyx_t_2;
15359  PyObject *__pyx_t_3 = NULL;
15360  PyObject *__pyx_t_4 = NULL;
15361  PyObject *__pyx_t_5 = NULL;
15362  PyObject *__pyx_t_6 = NULL;
15363  PyObject *__pyx_t_7 = NULL;
15364  PyObject *__pyx_t_8 = NULL;
15365  int __pyx_t_9;
15366  int __pyx_lineno = 0;
15367  const char *__pyx_filename = NULL;
15368  int __pyx_clineno = 0;
15369  __Pyx_RefNannySetupContext("is_slice", 0);
15370  __Pyx_TraceCall("is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
15371  __Pyx_INCREF(__pyx_v_obj);
15372 
15373  /* "View.MemoryView":434
15374  *
15375  * cdef is_slice(self, obj):
15376  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
15377  * try:
15378  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15379  */
15380  __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
15381  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
15382  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15383  if (__pyx_t_2) {
15384 
15385  /* "View.MemoryView":435
15386  * cdef is_slice(self, obj):
15387  * if not isinstance(obj, memoryview):
15388  * try: # <<<<<<<<<<<<<<
15389  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15390  * self.dtype_is_object)
15391  */
15392  __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
15393  {
15394  __Pyx_PyThreadState_declare
15395  __Pyx_PyThreadState_assign
15396  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
15397  __Pyx_XGOTREF(__pyx_t_3);
15398  __Pyx_XGOTREF(__pyx_t_4);
15399  __Pyx_XGOTREF(__pyx_t_5);
15400  /*try:*/ {
15401 
15402  /* "View.MemoryView":436
15403  * if not isinstance(obj, memoryview):
15404  * try:
15405  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
15406  * self.dtype_is_object)
15407  * except TypeError:
15408  */
15409  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
15410  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
15411  __Pyx_GOTREF(__pyx_t_6);
15412 
15413  /* "View.MemoryView":437
15414  * try:
15415  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15416  * self.dtype_is_object) # <<<<<<<<<<<<<<
15417  * except TypeError:
15418  * return None
15419  */
15420  __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
15421  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
15422  __Pyx_GOTREF(__pyx_t_7);
15423 
15424  /* "View.MemoryView":436
15425  * if not isinstance(obj, memoryview):
15426  * try:
15427  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
15428  * self.dtype_is_object)
15429  * except TypeError:
15430  */
15431  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
15432  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
15433  __Pyx_GOTREF(__pyx_t_8);
15434  __Pyx_INCREF(__pyx_v_obj);
15435  __Pyx_GIVEREF(__pyx_v_obj);
15436  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
15437  __Pyx_GIVEREF(__pyx_t_6);
15438  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
15439  __Pyx_GIVEREF(__pyx_t_7);
15440  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
15441  __pyx_t_6 = 0;
15442  __pyx_t_7 = 0;
15443  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
15444  __Pyx_GOTREF(__pyx_t_7);
15445  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15446  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
15447  __pyx_t_7 = 0;
15448 
15449  /* "View.MemoryView":435
15450  * cdef is_slice(self, obj):
15451  * if not isinstance(obj, memoryview):
15452  * try: # <<<<<<<<<<<<<<
15453  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15454  * self.dtype_is_object)
15455  */
15456  }
15457  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15458  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15459  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15460  goto __pyx_L9_try_end;
15461  __pyx_L4_error:;
15462  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15463  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15464  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15465 
15466  /* "View.MemoryView":438
15467  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15468  * self.dtype_is_object)
15469  * except TypeError: # <<<<<<<<<<<<<<
15470  * return None
15471  *
15472  */
15473  __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
15474  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
15475  if (__pyx_t_9) {
15476  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15477  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
15478  __Pyx_GOTREF(__pyx_t_7);
15479  __Pyx_GOTREF(__pyx_t_8);
15480  __Pyx_GOTREF(__pyx_t_6);
15481 
15482  /* "View.MemoryView":439
15483  * self.dtype_is_object)
15484  * except TypeError:
15485  * return None # <<<<<<<<<<<<<<
15486  *
15487  * return obj
15488  */
15489  __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
15490  __Pyx_XDECREF(__pyx_r);
15491  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15492  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15493  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15494  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15495  goto __pyx_L7_except_return;
15496  }
15497  goto __pyx_L6_except_error;
15498  __pyx_L6_except_error:;
15499 
15500  /* "View.MemoryView":435
15501  * cdef is_slice(self, obj):
15502  * if not isinstance(obj, memoryview):
15503  * try: # <<<<<<<<<<<<<<
15504  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15505  * self.dtype_is_object)
15506  */
15507  __Pyx_XGIVEREF(__pyx_t_3);
15508  __Pyx_XGIVEREF(__pyx_t_4);
15509  __Pyx_XGIVEREF(__pyx_t_5);
15510  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15511  goto __pyx_L1_error;
15512  __pyx_L7_except_return:;
15513  __Pyx_XGIVEREF(__pyx_t_3);
15514  __Pyx_XGIVEREF(__pyx_t_4);
15515  __Pyx_XGIVEREF(__pyx_t_5);
15516  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15517  goto __pyx_L0;
15518  __pyx_L9_try_end:;
15519  }
15520 
15521  /* "View.MemoryView":434
15522  *
15523  * cdef is_slice(self, obj):
15524  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
15525  * try:
15526  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15527  */
15528  }
15529 
15530  /* "View.MemoryView":441
15531  * return None
15532  *
15533  * return obj # <<<<<<<<<<<<<<
15534  *
15535  * cdef setitem_slice_assignment(self, dst, src):
15536  */
15537  __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
15538  __Pyx_XDECREF(__pyx_r);
15539  __Pyx_INCREF(__pyx_v_obj);
15540  __pyx_r = __pyx_v_obj;
15541  goto __pyx_L0;
15542 
15543  /* "View.MemoryView":433
15544  * self.setitem_indexed(index, value)
15545  *
15546  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
15547  * if not isinstance(obj, memoryview):
15548  * try:
15549  */
15550 
15551  /* function exit code */
15552  __pyx_L1_error:;
15553  __Pyx_XDECREF(__pyx_t_6);
15554  __Pyx_XDECREF(__pyx_t_7);
15555  __Pyx_XDECREF(__pyx_t_8);
15556  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15557  __pyx_r = 0;
15558  __pyx_L0:;
15559  __Pyx_XDECREF(__pyx_v_obj);
15560  __Pyx_XGIVEREF(__pyx_r);
15561  __Pyx_TraceReturn(__pyx_r, 0);
15562  __Pyx_RefNannyFinishContext();
15563  return __pyx_r;
15564 }
15565 
15566 /* "View.MemoryView":443
15567  * return obj
15568  *
15569  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
15570  * cdef __Pyx_memviewslice dst_slice
15571  * cdef __Pyx_memviewslice src_slice
15572  */
15573 
15574 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
15575  __Pyx_memviewslice __pyx_v_dst_slice;
15576  __Pyx_memviewslice __pyx_v_src_slice;
15577  PyObject *__pyx_r = NULL;
15578  __Pyx_TraceDeclarations
15579  __Pyx_RefNannyDeclarations
15580  __Pyx_memviewslice *__pyx_t_1;
15581  __Pyx_memviewslice *__pyx_t_2;
15582  PyObject *__pyx_t_3 = NULL;
15583  int __pyx_t_4;
15584  int __pyx_t_5;
15585  int __pyx_t_6;
15586  int __pyx_lineno = 0;
15587  const char *__pyx_filename = NULL;
15588  int __pyx_clineno = 0;
15589  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
15590  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
15591 
15592  /* "View.MemoryView":447
15593  * cdef __Pyx_memviewslice src_slice
15594  *
15595  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
15596  * get_slice_from_memview(dst, &dst_slice)[0],
15597  * src.ndim, dst.ndim, self.dtype_is_object)
15598  */
15599  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
15600  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
15601  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
15602 
15603  /* "View.MemoryView":448
15604  *
15605  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
15606  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
15607  * src.ndim, dst.ndim, self.dtype_is_object)
15608  *
15609  */
15610  __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
15611  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
15612  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
15613 
15614  /* "View.MemoryView":449
15615  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
15616  * get_slice_from_memview(dst, &dst_slice)[0],
15617  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
15618  *
15619  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
15620  */
15621  __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
15622  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
15623  __Pyx_GOTREF(__pyx_t_3);
15624  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
15625  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15626  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
15627  __Pyx_GOTREF(__pyx_t_3);
15628  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
15629  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15630 
15631  /* "View.MemoryView":447
15632  * cdef __Pyx_memviewslice src_slice
15633  *
15634  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
15635  * get_slice_from_memview(dst, &dst_slice)[0],
15636  * src.ndim, dst.ndim, self.dtype_is_object)
15637  */
15638  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
15639  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
15640 
15641  /* "View.MemoryView":443
15642  * return obj
15643  *
15644  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
15645  * cdef __Pyx_memviewslice dst_slice
15646  * cdef __Pyx_memviewslice src_slice
15647  */
15648 
15649  /* function exit code */
15650  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15651  goto __pyx_L0;
15652  __pyx_L1_error:;
15653  __Pyx_XDECREF(__pyx_t_3);
15654  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
15655  __pyx_r = 0;
15656  __pyx_L0:;
15657  __Pyx_XGIVEREF(__pyx_r);
15658  __Pyx_TraceReturn(__pyx_r, 0);
15659  __Pyx_RefNannyFinishContext();
15660  return __pyx_r;
15661 }
15662 
15663 /* "View.MemoryView":451
15664  * src.ndim, dst.ndim, self.dtype_is_object)
15665  *
15666  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
15667  * cdef int array[128]
15668  * cdef void *tmp = NULL
15669  */
15670 
15671 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
15672  int __pyx_v_array[0x80];
15673  void *__pyx_v_tmp;
15674  void *__pyx_v_item;
15675  __Pyx_memviewslice *__pyx_v_dst_slice;
15676  __Pyx_memviewslice __pyx_v_tmp_slice;
15677  PyObject *__pyx_r = NULL;
15678  __Pyx_TraceDeclarations
15679  __Pyx_RefNannyDeclarations
15680  __Pyx_memviewslice *__pyx_t_1;
15681  int __pyx_t_2;
15682  PyObject *__pyx_t_3 = NULL;
15683  int __pyx_t_4;
15684  int __pyx_t_5;
15685  char const *__pyx_t_6;
15686  PyObject *__pyx_t_7 = NULL;
15687  PyObject *__pyx_t_8 = NULL;
15688  PyObject *__pyx_t_9 = NULL;
15689  PyObject *__pyx_t_10 = NULL;
15690  PyObject *__pyx_t_11 = NULL;
15691  PyObject *__pyx_t_12 = NULL;
15692  int __pyx_lineno = 0;
15693  const char *__pyx_filename = NULL;
15694  int __pyx_clineno = 0;
15695  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
15696  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
15697 
15698  /* "View.MemoryView":453
15699  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
15700  * cdef int array[128]
15701  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
15702  * cdef void *item
15703  *
15704  */
15705  __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
15706  __pyx_v_tmp = NULL;
15707 
15708  /* "View.MemoryView":458
15709  * cdef __Pyx_memviewslice *dst_slice
15710  * cdef __Pyx_memviewslice tmp_slice
15711  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
15712  *
15713  * if <size_t>self.view.itemsize > sizeof(array):
15714  */
15715  __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
15716  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
15717  __pyx_v_dst_slice = __pyx_t_1;
15718 
15719  /* "View.MemoryView":460
15720  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
15721  *
15722  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
15723  * tmp = PyMem_Malloc(self.view.itemsize)
15724  * if tmp == NULL:
15725  */
15726  __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
15727  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
15728  if (__pyx_t_2) {
15729 
15730  /* "View.MemoryView":461
15731  *
15732  * if <size_t>self.view.itemsize > sizeof(array):
15733  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
15734  * if tmp == NULL:
15735  * raise MemoryError
15736  */
15737  __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
15738  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
15739 
15740  /* "View.MemoryView":462
15741  * if <size_t>self.view.itemsize > sizeof(array):
15742  * tmp = PyMem_Malloc(self.view.itemsize)
15743  * if tmp == NULL: # <<<<<<<<<<<<<<
15744  * raise MemoryError
15745  * item = tmp
15746  */
15747  __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
15748  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
15749  if (unlikely(__pyx_t_2)) {
15750 
15751  /* "View.MemoryView":463
15752  * tmp = PyMem_Malloc(self.view.itemsize)
15753  * if tmp == NULL:
15754  * raise MemoryError # <<<<<<<<<<<<<<
15755  * item = tmp
15756  * else:
15757  */
15758  __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
15759  PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
15760 
15761  /* "View.MemoryView":462
15762  * if <size_t>self.view.itemsize > sizeof(array):
15763  * tmp = PyMem_Malloc(self.view.itemsize)
15764  * if tmp == NULL: # <<<<<<<<<<<<<<
15765  * raise MemoryError
15766  * item = tmp
15767  */
15768  }
15769 
15770  /* "View.MemoryView":464
15771  * if tmp == NULL:
15772  * raise MemoryError
15773  * item = tmp # <<<<<<<<<<<<<<
15774  * else:
15775  * item = <void *> array
15776  */
15777  __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
15778  __pyx_v_item = __pyx_v_tmp;
15779 
15780  /* "View.MemoryView":460
15781  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
15782  *
15783  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
15784  * tmp = PyMem_Malloc(self.view.itemsize)
15785  * if tmp == NULL:
15786  */
15787  goto __pyx_L3;
15788  }
15789 
15790  /* "View.MemoryView":466
15791  * item = tmp
15792  * else:
15793  * item = <void *> array # <<<<<<<<<<<<<<
15794  *
15795  * try:
15796  */
15797  __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
15798  /*else*/ {
15799  __pyx_v_item = ((void *)__pyx_v_array);
15800  }
15801  __pyx_L3:;
15802 
15803  /* "View.MemoryView":468
15804  * item = <void *> array
15805  *
15806  * try: # <<<<<<<<<<<<<<
15807  * if self.dtype_is_object:
15808  * (<PyObject **> item)[0] = <PyObject *> value
15809  */
15810  __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
15811  /*try:*/ {
15812 
15813  /* "View.MemoryView":469
15814  *
15815  * try:
15816  * if self.dtype_is_object: # <<<<<<<<<<<<<<
15817  * (<PyObject **> item)[0] = <PyObject *> value
15818  * else:
15819  */
15820  __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
15821  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
15822  if (__pyx_t_2) {
15823 
15824  /* "View.MemoryView":470
15825  * try:
15826  * if self.dtype_is_object:
15827  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
15828  * else:
15829  * self.assign_item_from_object(<char *> item, value)
15830  */
15831  __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
15832  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
15833 
15834  /* "View.MemoryView":469
15835  *
15836  * try:
15837  * if self.dtype_is_object: # <<<<<<<<<<<<<<
15838  * (<PyObject **> item)[0] = <PyObject *> value
15839  * else:
15840  */
15841  goto __pyx_L8;
15842  }
15843 
15844  /* "View.MemoryView":472
15845  * (<PyObject **> item)[0] = <PyObject *> value
15846  * else:
15847  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
15848  *
15849  *
15850  */
15851  __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
15852  /*else*/ {
15853  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
15854  __Pyx_GOTREF(__pyx_t_3);
15855  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15856  }
15857  __pyx_L8:;
15858 
15859  /* "View.MemoryView":476
15860  *
15861  *
15862  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
15863  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
15864  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
15865  */
15866  __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
15867  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
15868  if (__pyx_t_2) {
15869 
15870  /* "View.MemoryView":477
15871  *
15872  * if self.view.suboffsets != NULL:
15873  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
15874  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
15875  * item, self.dtype_is_object)
15876  */
15877  __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
15878  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
15879  __Pyx_GOTREF(__pyx_t_3);
15880  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15881 
15882  /* "View.MemoryView":476
15883  *
15884  *
15885  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
15886  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
15887  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
15888  */
15889  }
15890 
15891  /* "View.MemoryView":478
15892  * if self.view.suboffsets != NULL:
15893  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
15894  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
15895  * item, self.dtype_is_object)
15896  * finally:
15897  */
15898  __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
15899  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
15900  }
15901 
15902  /* "View.MemoryView":481
15903  * item, self.dtype_is_object)
15904  * finally:
15905  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
15906  *
15907  * cdef setitem_indexed(self, index, value):
15908  */
15909  __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
15910  /*finally:*/ {
15911  /*normal exit:*/{
15912  PyMem_Free(__pyx_v_tmp);
15913  goto __pyx_L7;
15914  }
15915  __pyx_L6_error:;
15916  /*exception exit:*/{
15917  __Pyx_PyThreadState_declare
15918  __Pyx_PyThreadState_assign
15919  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15920  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15921  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
15922  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
15923  __Pyx_XGOTREF(__pyx_t_7);
15924  __Pyx_XGOTREF(__pyx_t_8);
15925  __Pyx_XGOTREF(__pyx_t_9);
15926  __Pyx_XGOTREF(__pyx_t_10);
15927  __Pyx_XGOTREF(__pyx_t_11);
15928  __Pyx_XGOTREF(__pyx_t_12);
15929  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
15930  {
15931  PyMem_Free(__pyx_v_tmp);
15932  }
15933  if (PY_MAJOR_VERSION >= 3) {
15934  __Pyx_XGIVEREF(__pyx_t_10);
15935  __Pyx_XGIVEREF(__pyx_t_11);
15936  __Pyx_XGIVEREF(__pyx_t_12);
15937  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
15938  }
15939  __Pyx_XGIVEREF(__pyx_t_7);
15940  __Pyx_XGIVEREF(__pyx_t_8);
15941  __Pyx_XGIVEREF(__pyx_t_9);
15942  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
15943  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15944  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
15945  goto __pyx_L1_error;
15946  }
15947  __pyx_L7:;
15948  }
15949 
15950  /* "View.MemoryView":451
15951  * src.ndim, dst.ndim, self.dtype_is_object)
15952  *
15953  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
15954  * cdef int array[128]
15955  * cdef void *tmp = NULL
15956  */
15957 
15958  /* function exit code */
15959  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15960  goto __pyx_L0;
15961  __pyx_L1_error:;
15962  __Pyx_XDECREF(__pyx_t_3);
15963  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
15964  __pyx_r = 0;
15965  __pyx_L0:;
15966  __Pyx_XGIVEREF(__pyx_r);
15967  __Pyx_TraceReturn(__pyx_r, 0);
15968  __Pyx_RefNannyFinishContext();
15969  return __pyx_r;
15970 }
15971 
15972 /* "View.MemoryView":483
15973  * PyMem_Free(tmp)
15974  *
15975  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
15976  * cdef char *itemp = self.get_item_pointer(index)
15977  * self.assign_item_from_object(itemp, value)
15978  */
15979 
15980 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
15981  char *__pyx_v_itemp;
15982  PyObject *__pyx_r = NULL;
15983  __Pyx_TraceDeclarations
15984  __Pyx_RefNannyDeclarations
15985  char *__pyx_t_1;
15986  PyObject *__pyx_t_2 = NULL;
15987  int __pyx_lineno = 0;
15988  const char *__pyx_filename = NULL;
15989  int __pyx_clineno = 0;
15990  __Pyx_RefNannySetupContext("setitem_indexed", 0);
15991  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
15992 
15993  /* "View.MemoryView":484
15994  *
15995  * cdef setitem_indexed(self, index, value):
15996  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
15997  * self.assign_item_from_object(itemp, value)
15998  *
15999  */
16000  __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
16001  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
16002  __pyx_v_itemp = __pyx_t_1;
16003 
16004  /* "View.MemoryView":485
16005  * cdef setitem_indexed(self, index, value):
16006  * cdef char *itemp = self.get_item_pointer(index)
16007  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
16008  *
16009  * cdef convert_item_to_object(self, char *itemp):
16010  */
16011  __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
16012  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
16013  __Pyx_GOTREF(__pyx_t_2);
16014  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16015 
16016  /* "View.MemoryView":483
16017  * PyMem_Free(tmp)
16018  *
16019  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
16020  * cdef char *itemp = self.get_item_pointer(index)
16021  * self.assign_item_from_object(itemp, value)
16022  */
16023 
16024  /* function exit code */
16025  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16026  goto __pyx_L0;
16027  __pyx_L1_error:;
16028  __Pyx_XDECREF(__pyx_t_2);
16029  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
16030  __pyx_r = 0;
16031  __pyx_L0:;
16032  __Pyx_XGIVEREF(__pyx_r);
16033  __Pyx_TraceReturn(__pyx_r, 0);
16034  __Pyx_RefNannyFinishContext();
16035  return __pyx_r;
16036 }
16037 
16038 /* "View.MemoryView":487
16039  * self.assign_item_from_object(itemp, value)
16040  *
16041  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16042  * """Only used if instantiated manually by the user, or if Cython doesn't
16043  * know how to convert the type"""
16044  */
16045 
16046 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
16047  PyObject *__pyx_v_struct = NULL;
16048  PyObject *__pyx_v_bytesitem = 0;
16049  PyObject *__pyx_v_result = NULL;
16050  PyObject *__pyx_r = NULL;
16051  __Pyx_TraceDeclarations
16052  __Pyx_RefNannyDeclarations
16053  PyObject *__pyx_t_1 = NULL;
16054  PyObject *__pyx_t_2 = NULL;
16055  PyObject *__pyx_t_3 = NULL;
16056  PyObject *__pyx_t_4 = NULL;
16057  PyObject *__pyx_t_5 = NULL;
16058  PyObject *__pyx_t_6 = NULL;
16059  PyObject *__pyx_t_7 = NULL;
16060  int __pyx_t_8;
16061  PyObject *__pyx_t_9 = NULL;
16062  size_t __pyx_t_10;
16063  int __pyx_t_11;
16064  int __pyx_lineno = 0;
16065  const char *__pyx_filename = NULL;
16066  int __pyx_clineno = 0;
16067  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
16068  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
16069 
16070  /* "View.MemoryView":490
16071  * """Only used if instantiated manually by the user, or if Cython doesn't
16072  * know how to convert the type"""
16073  * import struct # <<<<<<<<<<<<<<
16074  * cdef bytes bytesitem
16075  *
16076  */
16077  __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
16078  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
16079  __Pyx_GOTREF(__pyx_t_1);
16080  __pyx_v_struct = __pyx_t_1;
16081  __pyx_t_1 = 0;
16082 
16083  /* "View.MemoryView":493
16084  * cdef bytes bytesitem
16085  *
16086  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
16087  * try:
16088  * result = struct.unpack(self.view.format, bytesitem)
16089  */
16090  __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
16091  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
16092  __Pyx_GOTREF(__pyx_t_1);
16093  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
16094  __pyx_t_1 = 0;
16095 
16096  /* "View.MemoryView":494
16097  *
16098  * bytesitem = itemp[:self.view.itemsize]
16099  * try: # <<<<<<<<<<<<<<
16100  * result = struct.unpack(self.view.format, bytesitem)
16101  * except struct.error:
16102  */
16103  __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
16104  {
16105  __Pyx_PyThreadState_declare
16106  __Pyx_PyThreadState_assign
16107  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
16108  __Pyx_XGOTREF(__pyx_t_2);
16109  __Pyx_XGOTREF(__pyx_t_3);
16110  __Pyx_XGOTREF(__pyx_t_4);
16111  /*try:*/ {
16112 
16113  /* "View.MemoryView":495
16114  * bytesitem = itemp[:self.view.itemsize]
16115  * try:
16116  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
16117  * except struct.error:
16118  * raise ValueError("Unable to convert item to object")
16119  */
16120  __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
16121  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
16122  __Pyx_GOTREF(__pyx_t_5);
16123  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
16124  __Pyx_GOTREF(__pyx_t_6);
16125  __pyx_t_7 = NULL;
16126  __pyx_t_8 = 0;
16127  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
16128  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
16129  if (likely(__pyx_t_7)) {
16130  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
16131  __Pyx_INCREF(__pyx_t_7);
16132  __Pyx_INCREF(function);
16133  __Pyx_DECREF_SET(__pyx_t_5, function);
16134  __pyx_t_8 = 1;
16135  }
16136  }
16137  #if CYTHON_FAST_PYCALL
16138  if (PyFunction_Check(__pyx_t_5)) {
16139  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
16140  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
16141  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16142  __Pyx_GOTREF(__pyx_t_1);
16143  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16144  } else
16145  #endif
16146  #if CYTHON_FAST_PYCCALL
16147  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
16148  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
16149  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
16150  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16151  __Pyx_GOTREF(__pyx_t_1);
16152  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16153  } else
16154  #endif
16155  {
16156  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
16157  __Pyx_GOTREF(__pyx_t_9);
16158  if (__pyx_t_7) {
16159  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
16160  }
16161  __Pyx_GIVEREF(__pyx_t_6);
16162  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
16163  __Pyx_INCREF(__pyx_v_bytesitem);
16164  __Pyx_GIVEREF(__pyx_v_bytesitem);
16165  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
16166  __pyx_t_6 = 0;
16167  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
16168  __Pyx_GOTREF(__pyx_t_1);
16169  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16170  }
16171  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16172  __pyx_v_result = __pyx_t_1;
16173  __pyx_t_1 = 0;
16174 
16175  /* "View.MemoryView":494
16176  *
16177  * bytesitem = itemp[:self.view.itemsize]
16178  * try: # <<<<<<<<<<<<<<
16179  * result = struct.unpack(self.view.format, bytesitem)
16180  * except struct.error:
16181  */
16182  }
16183 
16184  /* "View.MemoryView":499
16185  * raise ValueError("Unable to convert item to object")
16186  * else:
16187  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
16188  * return result[0]
16189  * return result
16190  */
16191  __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
16192  /*else:*/ {
16193  __pyx_t_10 = strlen(__pyx_v_self->view.format);
16194  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
16195  if (__pyx_t_11) {
16196 
16197  /* "View.MemoryView":500
16198  * else:
16199  * if len(self.view.format) == 1:
16200  * return result[0] # <<<<<<<<<<<<<<
16201  * return result
16202  *
16203  */
16204  __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
16205  __Pyx_XDECREF(__pyx_r);
16206  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
16207  __Pyx_GOTREF(__pyx_t_1);
16208  __pyx_r = __pyx_t_1;
16209  __pyx_t_1 = 0;
16210  goto __pyx_L6_except_return;
16211 
16212  /* "View.MemoryView":499
16213  * raise ValueError("Unable to convert item to object")
16214  * else:
16215  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
16216  * return result[0]
16217  * return result
16218  */
16219  }
16220 
16221  /* "View.MemoryView":501
16222  * if len(self.view.format) == 1:
16223  * return result[0]
16224  * return result # <<<<<<<<<<<<<<
16225  *
16226  * cdef assign_item_from_object(self, char *itemp, object value):
16227  */
16228  __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
16229  __Pyx_XDECREF(__pyx_r);
16230  __Pyx_INCREF(__pyx_v_result);
16231  __pyx_r = __pyx_v_result;
16232  goto __pyx_L6_except_return;
16233  }
16234  __pyx_L3_error:;
16235  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16236  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16237  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16238  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16239  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16240 
16241  /* "View.MemoryView":496
16242  * try:
16243  * result = struct.unpack(self.view.format, bytesitem)
16244  * except struct.error: # <<<<<<<<<<<<<<
16245  * raise ValueError("Unable to convert item to object")
16246  * else:
16247  */
16248  __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
16249  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
16250  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
16251  __Pyx_GOTREF(__pyx_t_6);
16252  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
16253  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16254  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
16255  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
16256  if (__pyx_t_8) {
16257  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16258  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
16259  __Pyx_GOTREF(__pyx_t_9);
16260  __Pyx_GOTREF(__pyx_t_5);
16261  __Pyx_GOTREF(__pyx_t_1);
16262 
16263  /* "View.MemoryView":497
16264  * result = struct.unpack(self.view.format, bytesitem)
16265  * except struct.error:
16266  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
16267  * else:
16268  * if len(self.view.format) == 1:
16269  */
16270  __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
16271  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
16272  __Pyx_GOTREF(__pyx_t_6);
16273  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
16274  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16275  __PYX_ERR(1, 497, __pyx_L5_except_error)
16276  }
16277  goto __pyx_L5_except_error;
16278  __pyx_L5_except_error:;
16279 
16280  /* "View.MemoryView":494
16281  *
16282  * bytesitem = itemp[:self.view.itemsize]
16283  * try: # <<<<<<<<<<<<<<
16284  * result = struct.unpack(self.view.format, bytesitem)
16285  * except struct.error:
16286  */
16287  __Pyx_XGIVEREF(__pyx_t_2);
16288  __Pyx_XGIVEREF(__pyx_t_3);
16289  __Pyx_XGIVEREF(__pyx_t_4);
16290  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
16291  goto __pyx_L1_error;
16292  __pyx_L6_except_return:;
16293  __Pyx_XGIVEREF(__pyx_t_2);
16294  __Pyx_XGIVEREF(__pyx_t_3);
16295  __Pyx_XGIVEREF(__pyx_t_4);
16296  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
16297  goto __pyx_L0;
16298  }
16299 
16300  /* "View.MemoryView":487
16301  * self.assign_item_from_object(itemp, value)
16302  *
16303  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16304  * """Only used if instantiated manually by the user, or if Cython doesn't
16305  * know how to convert the type"""
16306  */
16307 
16308  /* function exit code */
16309  __pyx_L1_error:;
16310  __Pyx_XDECREF(__pyx_t_1);
16311  __Pyx_XDECREF(__pyx_t_5);
16312  __Pyx_XDECREF(__pyx_t_6);
16313  __Pyx_XDECREF(__pyx_t_7);
16314  __Pyx_XDECREF(__pyx_t_9);
16315  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16316  __pyx_r = 0;
16317  __pyx_L0:;
16318  __Pyx_XDECREF(__pyx_v_struct);
16319  __Pyx_XDECREF(__pyx_v_bytesitem);
16320  __Pyx_XDECREF(__pyx_v_result);
16321  __Pyx_XGIVEREF(__pyx_r);
16322  __Pyx_TraceReturn(__pyx_r, 0);
16323  __Pyx_RefNannyFinishContext();
16324  return __pyx_r;
16325 }
16326 
16327 /* "View.MemoryView":503
16328  * return result
16329  *
16330  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16331  * """Only used if instantiated manually by the user, or if Cython doesn't
16332  * know how to convert the type"""
16333  */
16334 
16335 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16336  PyObject *__pyx_v_struct = NULL;
16337  char __pyx_v_c;
16338  PyObject *__pyx_v_bytesvalue = 0;
16339  Py_ssize_t __pyx_v_i;
16340  PyObject *__pyx_r = NULL;
16341  __Pyx_TraceDeclarations
16342  __Pyx_RefNannyDeclarations
16343  PyObject *__pyx_t_1 = NULL;
16344  int __pyx_t_2;
16345  int __pyx_t_3;
16346  PyObject *__pyx_t_4 = NULL;
16347  PyObject *__pyx_t_5 = NULL;
16348  PyObject *__pyx_t_6 = NULL;
16349  int __pyx_t_7;
16350  PyObject *__pyx_t_8 = NULL;
16351  Py_ssize_t __pyx_t_9;
16352  PyObject *__pyx_t_10 = NULL;
16353  char *__pyx_t_11;
16354  char *__pyx_t_12;
16355  char *__pyx_t_13;
16356  char *__pyx_t_14;
16357  int __pyx_lineno = 0;
16358  const char *__pyx_filename = NULL;
16359  int __pyx_clineno = 0;
16360  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
16361  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
16362 
16363  /* "View.MemoryView":506
16364  * """Only used if instantiated manually by the user, or if Cython doesn't
16365  * know how to convert the type"""
16366  * import struct # <<<<<<<<<<<<<<
16367  * cdef char c
16368  * cdef bytes bytesvalue
16369  */
16370  __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
16371  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
16372  __Pyx_GOTREF(__pyx_t_1);
16373  __pyx_v_struct = __pyx_t_1;
16374  __pyx_t_1 = 0;
16375 
16376  /* "View.MemoryView":511
16377  * cdef Py_ssize_t i
16378  *
16379  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
16380  * bytesvalue = struct.pack(self.view.format, *value)
16381  * else:
16382  */
16383  __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
16384  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
16385  __pyx_t_3 = (__pyx_t_2 != 0);
16386  if (__pyx_t_3) {
16387 
16388  /* "View.MemoryView":512
16389  *
16390  * if isinstance(value, tuple):
16391  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
16392  * else:
16393  * bytesvalue = struct.pack(self.view.format, value)
16394  */
16395  __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
16396  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
16397  __Pyx_GOTREF(__pyx_t_1);
16398  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16399  __Pyx_GOTREF(__pyx_t_4);
16400  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
16401  __Pyx_GOTREF(__pyx_t_5);
16402  __Pyx_GIVEREF(__pyx_t_4);
16403  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
16404  __pyx_t_4 = 0;
16405  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16406  __Pyx_GOTREF(__pyx_t_4);
16407  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
16408  __Pyx_GOTREF(__pyx_t_6);
16409  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16410  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16411  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16412  __Pyx_GOTREF(__pyx_t_4);
16413  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16414  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16415  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
16416  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
16417  __pyx_t_4 = 0;
16418 
16419  /* "View.MemoryView":511
16420  * cdef Py_ssize_t i
16421  *
16422  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
16423  * bytesvalue = struct.pack(self.view.format, *value)
16424  * else:
16425  */
16426  goto __pyx_L3;
16427  }
16428 
16429  /* "View.MemoryView":514
16430  * bytesvalue = struct.pack(self.view.format, *value)
16431  * else:
16432  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
16433  *
16434  * for i, c in enumerate(bytesvalue):
16435  */
16436  __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
16437  /*else*/ {
16438  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
16439  __Pyx_GOTREF(__pyx_t_6);
16440  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
16441  __Pyx_GOTREF(__pyx_t_1);
16442  __pyx_t_5 = NULL;
16443  __pyx_t_7 = 0;
16444  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
16445  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16446  if (likely(__pyx_t_5)) {
16447  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
16448  __Pyx_INCREF(__pyx_t_5);
16449  __Pyx_INCREF(function);
16450  __Pyx_DECREF_SET(__pyx_t_6, function);
16451  __pyx_t_7 = 1;
16452  }
16453  }
16454  #if CYTHON_FAST_PYCALL
16455  if (PyFunction_Check(__pyx_t_6)) {
16456  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
16457  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
16458  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16459  __Pyx_GOTREF(__pyx_t_4);
16460  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16461  } else
16462  #endif
16463  #if CYTHON_FAST_PYCCALL
16464  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16465  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
16466  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
16467  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16468  __Pyx_GOTREF(__pyx_t_4);
16469  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16470  } else
16471  #endif
16472  {
16473  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
16474  __Pyx_GOTREF(__pyx_t_8);
16475  if (__pyx_t_5) {
16476  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
16477  }
16478  __Pyx_GIVEREF(__pyx_t_1);
16479  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
16480  __Pyx_INCREF(__pyx_v_value);
16481  __Pyx_GIVEREF(__pyx_v_value);
16482  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
16483  __pyx_t_1 = 0;
16484  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
16485  __Pyx_GOTREF(__pyx_t_4);
16486  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16487  }
16488  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16489  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
16490  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
16491  __pyx_t_4 = 0;
16492  }
16493  __pyx_L3:;
16494 
16495  /* "View.MemoryView":516
16496  * bytesvalue = struct.pack(self.view.format, value)
16497  *
16498  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
16499  * itemp[i] = c
16500  *
16501  */
16502  __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
16503  __pyx_t_9 = 0;
16504  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
16505  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
16506  __PYX_ERR(1, 516, __pyx_L1_error)
16507  }
16508  __Pyx_INCREF(__pyx_v_bytesvalue);
16509  __pyx_t_10 = __pyx_v_bytesvalue;
16510  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
16511  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
16512  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
16513  __pyx_t_11 = __pyx_t_14;
16514  __pyx_v_c = (__pyx_t_11[0]);
16515 
16516  /* "View.MemoryView":517
16517  *
16518  * for i, c in enumerate(bytesvalue):
16519  * itemp[i] = c # <<<<<<<<<<<<<<
16520  *
16521  * @cname('getbuffer')
16522  */
16523  __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
16524  __pyx_v_i = __pyx_t_9;
16525 
16526  /* "View.MemoryView":516
16527  * bytesvalue = struct.pack(self.view.format, value)
16528  *
16529  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
16530  * itemp[i] = c
16531  *
16532  */
16533  __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
16534  __pyx_t_9 = (__pyx_t_9 + 1);
16535 
16536  /* "View.MemoryView":517
16537  *
16538  * for i, c in enumerate(bytesvalue):
16539  * itemp[i] = c # <<<<<<<<<<<<<<
16540  *
16541  * @cname('getbuffer')
16542  */
16543  __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
16544  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
16545  }
16546  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16547 
16548  /* "View.MemoryView":503
16549  * return result
16550  *
16551  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16552  * """Only used if instantiated manually by the user, or if Cython doesn't
16553  * know how to convert the type"""
16554  */
16555 
16556  /* function exit code */
16557  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16558  goto __pyx_L0;
16559  __pyx_L1_error:;
16560  __Pyx_XDECREF(__pyx_t_1);
16561  __Pyx_XDECREF(__pyx_t_4);
16562  __Pyx_XDECREF(__pyx_t_5);
16563  __Pyx_XDECREF(__pyx_t_6);
16564  __Pyx_XDECREF(__pyx_t_8);
16565  __Pyx_XDECREF(__pyx_t_10);
16566  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16567  __pyx_r = 0;
16568  __pyx_L0:;
16569  __Pyx_XDECREF(__pyx_v_struct);
16570  __Pyx_XDECREF(__pyx_v_bytesvalue);
16571  __Pyx_XGIVEREF(__pyx_r);
16572  __Pyx_TraceReturn(__pyx_r, 0);
16573  __Pyx_RefNannyFinishContext();
16574  return __pyx_r;
16575 }
16576 
16577 /* "View.MemoryView":520
16578  *
16579  * @cname('getbuffer')
16580  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
16581  * if flags & PyBUF_WRITABLE and self.view.readonly:
16582  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16583  */
16584 
16585 /* Python wrapper */
16586 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
16587 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
16588  int __pyx_r;
16589  __Pyx_RefNannyDeclarations
16590  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
16591  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
16592 
16593  /* function exit code */
16594  __Pyx_RefNannyFinishContext();
16595  return __pyx_r;
16596 }
16597 
16598 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
16599  int __pyx_r;
16600  __Pyx_TraceDeclarations
16601  __Pyx_RefNannyDeclarations
16602  int __pyx_t_1;
16603  int __pyx_t_2;
16604  PyObject *__pyx_t_3 = NULL;
16605  Py_ssize_t *__pyx_t_4;
16606  char *__pyx_t_5;
16607  void *__pyx_t_6;
16608  int __pyx_t_7;
16609  Py_ssize_t __pyx_t_8;
16610  int __pyx_lineno = 0;
16611  const char *__pyx_filename = NULL;
16612  int __pyx_clineno = 0;
16613  if (__pyx_v_info == NULL) {
16614  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
16615  return -1;
16616  }
16617  __Pyx_RefNannySetupContext("__getbuffer__", 0);
16618  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
16619  __Pyx_GIVEREF(__pyx_v_info->obj);
16620  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
16621 
16622  /* "View.MemoryView":521
16623  * @cname('getbuffer')
16624  * def __getbuffer__(self, Py_buffer *info, int flags):
16625  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
16626  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16627  *
16628  */
16629  __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
16630  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
16631  if (__pyx_t_2) {
16632  } else {
16633  __pyx_t_1 = __pyx_t_2;
16634  goto __pyx_L4_bool_binop_done;
16635  }
16636  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
16637  __pyx_t_1 = __pyx_t_2;
16638  __pyx_L4_bool_binop_done:;
16639  if (unlikely(__pyx_t_1)) {
16640 
16641  /* "View.MemoryView":522
16642  * def __getbuffer__(self, Py_buffer *info, int flags):
16643  * if flags & PyBUF_WRITABLE and self.view.readonly:
16644  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
16645  *
16646  * if flags & PyBUF_ND:
16647  */
16648  __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
16649  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
16650  __Pyx_GOTREF(__pyx_t_3);
16651  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16652  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16653  __PYX_ERR(1, 522, __pyx_L1_error)
16654 
16655  /* "View.MemoryView":521
16656  * @cname('getbuffer')
16657  * def __getbuffer__(self, Py_buffer *info, int flags):
16658  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
16659  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16660  *
16661  */
16662  }
16663 
16664  /* "View.MemoryView":524
16665  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16666  *
16667  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
16668  * info.shape = self.view.shape
16669  * else:
16670  */
16671  __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
16672  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
16673  if (__pyx_t_1) {
16674 
16675  /* "View.MemoryView":525
16676  *
16677  * if flags & PyBUF_ND:
16678  * info.shape = self.view.shape # <<<<<<<<<<<<<<
16679  * else:
16680  * info.shape = NULL
16681  */
16682  __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
16683  __pyx_t_4 = __pyx_v_self->view.shape;
16684  __pyx_v_info->shape = __pyx_t_4;
16685 
16686  /* "View.MemoryView":524
16687  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16688  *
16689  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
16690  * info.shape = self.view.shape
16691  * else:
16692  */
16693  goto __pyx_L6;
16694  }
16695 
16696  /* "View.MemoryView":527
16697  * info.shape = self.view.shape
16698  * else:
16699  * info.shape = NULL # <<<<<<<<<<<<<<
16700  *
16701  * if flags & PyBUF_STRIDES:
16702  */
16703  __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
16704  /*else*/ {
16705  __pyx_v_info->shape = NULL;
16706  }
16707  __pyx_L6:;
16708 
16709  /* "View.MemoryView":529
16710  * info.shape = NULL
16711  *
16712  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
16713  * info.strides = self.view.strides
16714  * else:
16715  */
16716  __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
16717  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
16718  if (__pyx_t_1) {
16719 
16720  /* "View.MemoryView":530
16721  *
16722  * if flags & PyBUF_STRIDES:
16723  * info.strides = self.view.strides # <<<<<<<<<<<<<<
16724  * else:
16725  * info.strides = NULL
16726  */
16727  __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
16728  __pyx_t_4 = __pyx_v_self->view.strides;
16729  __pyx_v_info->strides = __pyx_t_4;
16730 
16731  /* "View.MemoryView":529
16732  * info.shape = NULL
16733  *
16734  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
16735  * info.strides = self.view.strides
16736  * else:
16737  */
16738  goto __pyx_L7;
16739  }
16740 
16741  /* "View.MemoryView":532
16742  * info.strides = self.view.strides
16743  * else:
16744  * info.strides = NULL # <<<<<<<<<<<<<<
16745  *
16746  * if flags & PyBUF_INDIRECT:
16747  */
16748  __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
16749  /*else*/ {
16750  __pyx_v_info->strides = NULL;
16751  }
16752  __pyx_L7:;
16753 
16754  /* "View.MemoryView":534
16755  * info.strides = NULL
16756  *
16757  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
16758  * info.suboffsets = self.view.suboffsets
16759  * else:
16760  */
16761  __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
16762  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
16763  if (__pyx_t_1) {
16764 
16765  /* "View.MemoryView":535
16766  *
16767  * if flags & PyBUF_INDIRECT:
16768  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
16769  * else:
16770  * info.suboffsets = NULL
16771  */
16772  __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
16773  __pyx_t_4 = __pyx_v_self->view.suboffsets;
16774  __pyx_v_info->suboffsets = __pyx_t_4;
16775 
16776  /* "View.MemoryView":534
16777  * info.strides = NULL
16778  *
16779  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
16780  * info.suboffsets = self.view.suboffsets
16781  * else:
16782  */
16783  goto __pyx_L8;
16784  }
16785 
16786  /* "View.MemoryView":537
16787  * info.suboffsets = self.view.suboffsets
16788  * else:
16789  * info.suboffsets = NULL # <<<<<<<<<<<<<<
16790  *
16791  * if flags & PyBUF_FORMAT:
16792  */
16793  __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
16794  /*else*/ {
16795  __pyx_v_info->suboffsets = NULL;
16796  }
16797  __pyx_L8:;
16798 
16799  /* "View.MemoryView":539
16800  * info.suboffsets = NULL
16801  *
16802  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
16803  * info.format = self.view.format
16804  * else:
16805  */
16806  __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
16807  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
16808  if (__pyx_t_1) {
16809 
16810  /* "View.MemoryView":540
16811  *
16812  * if flags & PyBUF_FORMAT:
16813  * info.format = self.view.format # <<<<<<<<<<<<<<
16814  * else:
16815  * info.format = NULL
16816  */
16817  __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
16818  __pyx_t_5 = __pyx_v_self->view.format;
16819  __pyx_v_info->format = __pyx_t_5;
16820 
16821  /* "View.MemoryView":539
16822  * info.suboffsets = NULL
16823  *
16824  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
16825  * info.format = self.view.format
16826  * else:
16827  */
16828  goto __pyx_L9;
16829  }
16830 
16831  /* "View.MemoryView":542
16832  * info.format = self.view.format
16833  * else:
16834  * info.format = NULL # <<<<<<<<<<<<<<
16835  *
16836  * info.buf = self.view.buf
16837  */
16838  __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
16839  /*else*/ {
16840  __pyx_v_info->format = NULL;
16841  }
16842  __pyx_L9:;
16843 
16844  /* "View.MemoryView":544
16845  * info.format = NULL
16846  *
16847  * info.buf = self.view.buf # <<<<<<<<<<<<<<
16848  * info.ndim = self.view.ndim
16849  * info.itemsize = self.view.itemsize
16850  */
16851  __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
16852  __pyx_t_6 = __pyx_v_self->view.buf;
16853  __pyx_v_info->buf = __pyx_t_6;
16854 
16855  /* "View.MemoryView":545
16856  *
16857  * info.buf = self.view.buf
16858  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
16859  * info.itemsize = self.view.itemsize
16860  * info.len = self.view.len
16861  */
16862  __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
16863  __pyx_t_7 = __pyx_v_self->view.ndim;
16864  __pyx_v_info->ndim = __pyx_t_7;
16865 
16866  /* "View.MemoryView":546
16867  * info.buf = self.view.buf
16868  * info.ndim = self.view.ndim
16869  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
16870  * info.len = self.view.len
16871  * info.readonly = self.view.readonly
16872  */
16873  __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
16874  __pyx_t_8 = __pyx_v_self->view.itemsize;
16875  __pyx_v_info->itemsize = __pyx_t_8;
16876 
16877  /* "View.MemoryView":547
16878  * info.ndim = self.view.ndim
16879  * info.itemsize = self.view.itemsize
16880  * info.len = self.view.len # <<<<<<<<<<<<<<
16881  * info.readonly = self.view.readonly
16882  * info.obj = self
16883  */
16884  __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
16885  __pyx_t_8 = __pyx_v_self->view.len;
16886  __pyx_v_info->len = __pyx_t_8;
16887 
16888  /* "View.MemoryView":548
16889  * info.itemsize = self.view.itemsize
16890  * info.len = self.view.len
16891  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
16892  * info.obj = self
16893  *
16894  */
16895  __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
16896  __pyx_t_1 = __pyx_v_self->view.readonly;
16897  __pyx_v_info->readonly = __pyx_t_1;
16898 
16899  /* "View.MemoryView":549
16900  * info.len = self.view.len
16901  * info.readonly = self.view.readonly
16902  * info.obj = self # <<<<<<<<<<<<<<
16903  *
16904  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16905  */
16906  __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
16907  __Pyx_INCREF(((PyObject *)__pyx_v_self));
16908  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16909  __Pyx_GOTREF(__pyx_v_info->obj);
16910  __Pyx_DECREF(__pyx_v_info->obj);
16911  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
16912 
16913  /* "View.MemoryView":520
16914  *
16915  * @cname('getbuffer')
16916  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
16917  * if flags & PyBUF_WRITABLE and self.view.readonly:
16918  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16919  */
16920 
16921  /* function exit code */
16922  __pyx_r = 0;
16923  goto __pyx_L0;
16924  __pyx_L1_error:;
16925  __Pyx_XDECREF(__pyx_t_3);
16926  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16927  __pyx_r = -1;
16928  if (__pyx_v_info->obj != NULL) {
16929  __Pyx_GOTREF(__pyx_v_info->obj);
16930  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16931  }
16932  goto __pyx_L2;
16933  __pyx_L0:;
16934  if (__pyx_v_info->obj == Py_None) {
16935  __Pyx_GOTREF(__pyx_v_info->obj);
16936  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16937  }
16938  __pyx_L2:;
16939  __Pyx_TraceReturn(Py_None, 0);
16940  __Pyx_RefNannyFinishContext();
16941  return __pyx_r;
16942 }
16943 
16944 /* "View.MemoryView":555
16945  *
16946  * @property
16947  * def T(self): # <<<<<<<<<<<<<<
16948  * cdef _memoryviewslice result = memoryview_copy(self)
16949  * transpose_memslice(&result.from_slice)
16950  */
16951 
16952 /* Python wrapper */
16953 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
16954 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
16955  PyObject *__pyx_r = 0;
16956  __Pyx_RefNannyDeclarations
16957  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16958  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16959 
16960  /* function exit code */
16961  __Pyx_RefNannyFinishContext();
16962  return __pyx_r;
16963 }
16964 
16965 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16966  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16967  PyObject *__pyx_r = NULL;
16968  __Pyx_TraceDeclarations
16969  __Pyx_RefNannyDeclarations
16970  PyObject *__pyx_t_1 = NULL;
16971  int __pyx_t_2;
16972  int __pyx_lineno = 0;
16973  const char *__pyx_filename = NULL;
16974  int __pyx_clineno = 0;
16975  __Pyx_RefNannySetupContext("__get__", 0);
16976  __Pyx_TraceCall("__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
16977 
16978  /* "View.MemoryView":556
16979  * @property
16980  * def T(self):
16981  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
16982  * transpose_memslice(&result.from_slice)
16983  * return result
16984  */
16985  __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
16986  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
16987  __Pyx_GOTREF(__pyx_t_1);
16988  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
16989  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
16990  __pyx_t_1 = 0;
16991 
16992  /* "View.MemoryView":557
16993  * def T(self):
16994  * cdef _memoryviewslice result = memoryview_copy(self)
16995  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
16996  * return result
16997  *
16998  */
16999  __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
17000  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
17001 
17002  /* "View.MemoryView":558
17003  * cdef _memoryviewslice result = memoryview_copy(self)
17004  * transpose_memslice(&result.from_slice)
17005  * return result # <<<<<<<<<<<<<<
17006  *
17007  * @property
17008  */
17009  __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
17010  __Pyx_XDECREF(__pyx_r);
17011  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17012  __pyx_r = ((PyObject *)__pyx_v_result);
17013  goto __pyx_L0;
17014 
17015  /* "View.MemoryView":555
17016  *
17017  * @property
17018  * def T(self): # <<<<<<<<<<<<<<
17019  * cdef _memoryviewslice result = memoryview_copy(self)
17020  * transpose_memslice(&result.from_slice)
17021  */
17022 
17023  /* function exit code */
17024  __pyx_L1_error:;
17025  __Pyx_XDECREF(__pyx_t_1);
17026  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17027  __pyx_r = NULL;
17028  __pyx_L0:;
17029  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17030  __Pyx_XGIVEREF(__pyx_r);
17031  __Pyx_TraceReturn(__pyx_r, 0);
17032  __Pyx_RefNannyFinishContext();
17033  return __pyx_r;
17034 }
17035 
17036 /* "View.MemoryView":561
17037  *
17038  * @property
17039  * def base(self): # <<<<<<<<<<<<<<
17040  * return self.obj
17041  *
17042  */
17043 
17044 /* Python wrapper */
17045 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17046 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
17047  PyObject *__pyx_r = 0;
17048  __Pyx_RefNannyDeclarations
17049  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17050  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17051 
17052  /* function exit code */
17053  __Pyx_RefNannyFinishContext();
17054  return __pyx_r;
17055 }
17056 
17057 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17058  PyObject *__pyx_r = NULL;
17059  __Pyx_TraceDeclarations
17060  __Pyx_RefNannyDeclarations
17061  int __pyx_lineno = 0;
17062  const char *__pyx_filename = NULL;
17063  int __pyx_clineno = 0;
17064  __Pyx_RefNannySetupContext("__get__", 0);
17065  __Pyx_TraceCall("__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
17066 
17067  /* "View.MemoryView":562
17068  * @property
17069  * def base(self):
17070  * return self.obj # <<<<<<<<<<<<<<
17071  *
17072  * @property
17073  */
17074  __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
17075  __Pyx_XDECREF(__pyx_r);
17076  __Pyx_INCREF(__pyx_v_self->obj);
17077  __pyx_r = __pyx_v_self->obj;
17078  goto __pyx_L0;
17079 
17080  /* "View.MemoryView":561
17081  *
17082  * @property
17083  * def base(self): # <<<<<<<<<<<<<<
17084  * return self.obj
17085  *
17086  */
17087 
17088  /* function exit code */
17089  __pyx_L1_error:;
17090  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17091  __pyx_r = NULL;
17092  __pyx_L0:;
17093  __Pyx_XGIVEREF(__pyx_r);
17094  __Pyx_TraceReturn(__pyx_r, 0);
17095  __Pyx_RefNannyFinishContext();
17096  return __pyx_r;
17097 }
17098 
17099 /* "View.MemoryView":565
17100  *
17101  * @property
17102  * def shape(self): # <<<<<<<<<<<<<<
17103  * return tuple([length for length in self.view.shape[:self.view.ndim]])
17104  *
17105  */
17106 
17107 /* Python wrapper */
17108 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
17109 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
17110  PyObject *__pyx_r = 0;
17111  __Pyx_RefNannyDeclarations
17112  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17113  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17114 
17115  /* function exit code */
17116  __Pyx_RefNannyFinishContext();
17117  return __pyx_r;
17118 }
17119 
17120 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17121  Py_ssize_t __pyx_v_length;
17122  PyObject *__pyx_r = NULL;
17123  __Pyx_TraceDeclarations
17124  __Pyx_RefNannyDeclarations
17125  PyObject *__pyx_t_1 = NULL;
17126  Py_ssize_t *__pyx_t_2;
17127  Py_ssize_t *__pyx_t_3;
17128  Py_ssize_t *__pyx_t_4;
17129  PyObject *__pyx_t_5 = NULL;
17130  int __pyx_lineno = 0;
17131  const char *__pyx_filename = NULL;
17132  int __pyx_clineno = 0;
17133  __Pyx_RefNannySetupContext("__get__", 0);
17134  __Pyx_TraceCall("__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
17135 
17136  /* "View.MemoryView":566
17137  * @property
17138  * def shape(self):
17139  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
17140  *
17141  * @property
17142  */
17143  __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
17144  __Pyx_XDECREF(__pyx_r);
17145  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
17146  __Pyx_GOTREF(__pyx_t_1);
17147  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
17148  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17149  __pyx_t_2 = __pyx_t_4;
17150  __pyx_v_length = (__pyx_t_2[0]);
17151  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
17152  __Pyx_GOTREF(__pyx_t_5);
17153  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
17154  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17155  }
17156  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
17157  __Pyx_GOTREF(__pyx_t_5);
17158  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17159  __pyx_r = __pyx_t_5;
17160  __pyx_t_5 = 0;
17161  goto __pyx_L0;
17162 
17163  /* "View.MemoryView":565
17164  *
17165  * @property
17166  * def shape(self): # <<<<<<<<<<<<<<
17167  * return tuple([length for length in self.view.shape[:self.view.ndim]])
17168  *
17169  */
17170 
17171  /* function exit code */
17172  __pyx_L1_error:;
17173  __Pyx_XDECREF(__pyx_t_1);
17174  __Pyx_XDECREF(__pyx_t_5);
17175  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17176  __pyx_r = NULL;
17177  __pyx_L0:;
17178  __Pyx_XGIVEREF(__pyx_r);
17179  __Pyx_TraceReturn(__pyx_r, 0);
17180  __Pyx_RefNannyFinishContext();
17181  return __pyx_r;
17182 }
17183 
17184 /* "View.MemoryView":569
17185  *
17186  * @property
17187  * def strides(self): # <<<<<<<<<<<<<<
17188  * if self.view.strides == NULL:
17189  *
17190  */
17191 
17192 /* Python wrapper */
17193 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
17194 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
17195  PyObject *__pyx_r = 0;
17196  __Pyx_RefNannyDeclarations
17197  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17198  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17199 
17200  /* function exit code */
17201  __Pyx_RefNannyFinishContext();
17202  return __pyx_r;
17203 }
17204 
17205 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17206  Py_ssize_t __pyx_v_stride;
17207  PyObject *__pyx_r = NULL;
17208  __Pyx_TraceDeclarations
17209  __Pyx_RefNannyDeclarations
17210  int __pyx_t_1;
17211  PyObject *__pyx_t_2 = NULL;
17212  Py_ssize_t *__pyx_t_3;
17213  Py_ssize_t *__pyx_t_4;
17214  Py_ssize_t *__pyx_t_5;
17215  PyObject *__pyx_t_6 = NULL;
17216  int __pyx_lineno = 0;
17217  const char *__pyx_filename = NULL;
17218  int __pyx_clineno = 0;
17219  __Pyx_RefNannySetupContext("__get__", 0);
17220  __Pyx_TraceCall("__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
17221 
17222  /* "View.MemoryView":570
17223  * @property
17224  * def strides(self):
17225  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
17226  *
17227  * raise ValueError("Buffer view does not expose strides")
17228  */
17229  __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
17230  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
17231  if (unlikely(__pyx_t_1)) {
17232 
17233  /* "View.MemoryView":572
17234  * if self.view.strides == NULL:
17235  *
17236  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
17237  *
17238  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
17239  */
17240  __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
17241  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
17242  __Pyx_GOTREF(__pyx_t_2);
17243  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17244  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17245  __PYX_ERR(1, 572, __pyx_L1_error)
17246 
17247  /* "View.MemoryView":570
17248  * @property
17249  * def strides(self):
17250  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
17251  *
17252  * raise ValueError("Buffer view does not expose strides")
17253  */
17254  }
17255 
17256  /* "View.MemoryView":574
17257  * raise ValueError("Buffer view does not expose strides")
17258  *
17259  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
17260  *
17261  * @property
17262  */
17263  __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
17264  __Pyx_XDECREF(__pyx_r);
17265  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
17266  __Pyx_GOTREF(__pyx_t_2);
17267  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
17268  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17269  __pyx_t_3 = __pyx_t_5;
17270  __pyx_v_stride = (__pyx_t_3[0]);
17271  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
17272  __Pyx_GOTREF(__pyx_t_6);
17273  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
17274  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17275  }
17276  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
17277  __Pyx_GOTREF(__pyx_t_6);
17278  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17279  __pyx_r = __pyx_t_6;
17280  __pyx_t_6 = 0;
17281  goto __pyx_L0;
17282 
17283  /* "View.MemoryView":569
17284  *
17285  * @property
17286  * def strides(self): # <<<<<<<<<<<<<<
17287  * if self.view.strides == NULL:
17288  *
17289  */
17290 
17291  /* function exit code */
17292  __pyx_L1_error:;
17293  __Pyx_XDECREF(__pyx_t_2);
17294  __Pyx_XDECREF(__pyx_t_6);
17295  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17296  __pyx_r = NULL;
17297  __pyx_L0:;
17298  __Pyx_XGIVEREF(__pyx_r);
17299  __Pyx_TraceReturn(__pyx_r, 0);
17300  __Pyx_RefNannyFinishContext();
17301  return __pyx_r;
17302 }
17303 
17304 /* "View.MemoryView":577
17305  *
17306  * @property
17307  * def suboffsets(self): # <<<<<<<<<<<<<<
17308  * if self.view.suboffsets == NULL:
17309  * return (-1,) * self.view.ndim
17310  */
17311 
17312 /* Python wrapper */
17313 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
17314 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
17315  PyObject *__pyx_r = 0;
17316  __Pyx_RefNannyDeclarations
17317  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17318  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17319 
17320  /* function exit code */
17321  __Pyx_RefNannyFinishContext();
17322  return __pyx_r;
17323 }
17324 
17325 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17326  Py_ssize_t __pyx_v_suboffset;
17327  PyObject *__pyx_r = NULL;
17328  __Pyx_TraceDeclarations
17329  __Pyx_RefNannyDeclarations
17330  int __pyx_t_1;
17331  PyObject *__pyx_t_2 = NULL;
17332  PyObject *__pyx_t_3 = NULL;
17333  Py_ssize_t *__pyx_t_4;
17334  Py_ssize_t *__pyx_t_5;
17335  Py_ssize_t *__pyx_t_6;
17336  int __pyx_lineno = 0;
17337  const char *__pyx_filename = NULL;
17338  int __pyx_clineno = 0;
17339  __Pyx_RefNannySetupContext("__get__", 0);
17340  __Pyx_TraceCall("__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
17341 
17342  /* "View.MemoryView":578
17343  * @property
17344  * def suboffsets(self):
17345  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
17346  * return (-1,) * self.view.ndim
17347  *
17348  */
17349  __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
17350  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
17351  if (__pyx_t_1) {
17352 
17353  /* "View.MemoryView":579
17354  * def suboffsets(self):
17355  * if self.view.suboffsets == NULL:
17356  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
17357  *
17358  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
17359  */
17360  __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
17361  __Pyx_XDECREF(__pyx_r);
17362  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
17363  __Pyx_GOTREF(__pyx_t_2);
17364  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__33, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
17365  __Pyx_GOTREF(__pyx_t_3);
17366  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17367  __pyx_r = __pyx_t_3;
17368  __pyx_t_3 = 0;
17369  goto __pyx_L0;
17370 
17371  /* "View.MemoryView":578
17372  * @property
17373  * def suboffsets(self):
17374  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
17375  * return (-1,) * self.view.ndim
17376  *
17377  */
17378  }
17379 
17380  /* "View.MemoryView":581
17381  * return (-1,) * self.view.ndim
17382  *
17383  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
17384  *
17385  * @property
17386  */
17387  __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
17388  __Pyx_XDECREF(__pyx_r);
17389  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
17390  __Pyx_GOTREF(__pyx_t_3);
17391  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
17392  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
17393  __pyx_t_4 = __pyx_t_6;
17394  __pyx_v_suboffset = (__pyx_t_4[0]);
17395  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
17396  __Pyx_GOTREF(__pyx_t_2);
17397  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
17398  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17399  }
17400  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
17401  __Pyx_GOTREF(__pyx_t_2);
17402  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17403  __pyx_r = __pyx_t_2;
17404  __pyx_t_2 = 0;
17405  goto __pyx_L0;
17406 
17407  /* "View.MemoryView":577
17408  *
17409  * @property
17410  * def suboffsets(self): # <<<<<<<<<<<<<<
17411  * if self.view.suboffsets == NULL:
17412  * return (-1,) * self.view.ndim
17413  */
17414 
17415  /* function exit code */
17416  __pyx_L1_error:;
17417  __Pyx_XDECREF(__pyx_t_2);
17418  __Pyx_XDECREF(__pyx_t_3);
17419  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17420  __pyx_r = NULL;
17421  __pyx_L0:;
17422  __Pyx_XGIVEREF(__pyx_r);
17423  __Pyx_TraceReturn(__pyx_r, 0);
17424  __Pyx_RefNannyFinishContext();
17425  return __pyx_r;
17426 }
17427 
17428 /* "View.MemoryView":584
17429  *
17430  * @property
17431  * def ndim(self): # <<<<<<<<<<<<<<
17432  * return self.view.ndim
17433  *
17434  */
17435 
17436 /* Python wrapper */
17437 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
17438 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
17439  PyObject *__pyx_r = 0;
17440  __Pyx_RefNannyDeclarations
17441  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17442  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17443 
17444  /* function exit code */
17445  __Pyx_RefNannyFinishContext();
17446  return __pyx_r;
17447 }
17448 
17449 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17450  PyObject *__pyx_r = NULL;
17451  __Pyx_TraceDeclarations
17452  __Pyx_RefNannyDeclarations
17453  PyObject *__pyx_t_1 = NULL;
17454  int __pyx_lineno = 0;
17455  const char *__pyx_filename = NULL;
17456  int __pyx_clineno = 0;
17457  __Pyx_RefNannySetupContext("__get__", 0);
17458  __Pyx_TraceCall("__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
17459 
17460  /* "View.MemoryView":585
17461  * @property
17462  * def ndim(self):
17463  * return self.view.ndim # <<<<<<<<<<<<<<
17464  *
17465  * @property
17466  */
17467  __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
17468  __Pyx_XDECREF(__pyx_r);
17469  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
17470  __Pyx_GOTREF(__pyx_t_1);
17471  __pyx_r = __pyx_t_1;
17472  __pyx_t_1 = 0;
17473  goto __pyx_L0;
17474 
17475  /* "View.MemoryView":584
17476  *
17477  * @property
17478  * def ndim(self): # <<<<<<<<<<<<<<
17479  * return self.view.ndim
17480  *
17481  */
17482 
17483  /* function exit code */
17484  __pyx_L1_error:;
17485  __Pyx_XDECREF(__pyx_t_1);
17486  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17487  __pyx_r = NULL;
17488  __pyx_L0:;
17489  __Pyx_XGIVEREF(__pyx_r);
17490  __Pyx_TraceReturn(__pyx_r, 0);
17491  __Pyx_RefNannyFinishContext();
17492  return __pyx_r;
17493 }
17494 
17495 /* "View.MemoryView":588
17496  *
17497  * @property
17498  * def itemsize(self): # <<<<<<<<<<<<<<
17499  * return self.view.itemsize
17500  *
17501  */
17502 
17503 /* Python wrapper */
17504 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
17505 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
17506  PyObject *__pyx_r = 0;
17507  __Pyx_RefNannyDeclarations
17508  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17509  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17510 
17511  /* function exit code */
17512  __Pyx_RefNannyFinishContext();
17513  return __pyx_r;
17514 }
17515 
17516 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17517  PyObject *__pyx_r = NULL;
17518  __Pyx_TraceDeclarations
17519  __Pyx_RefNannyDeclarations
17520  PyObject *__pyx_t_1 = NULL;
17521  int __pyx_lineno = 0;
17522  const char *__pyx_filename = NULL;
17523  int __pyx_clineno = 0;
17524  __Pyx_RefNannySetupContext("__get__", 0);
17525  __Pyx_TraceCall("__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
17526 
17527  /* "View.MemoryView":589
17528  * @property
17529  * def itemsize(self):
17530  * return self.view.itemsize # <<<<<<<<<<<<<<
17531  *
17532  * @property
17533  */
17534  __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
17535  __Pyx_XDECREF(__pyx_r);
17536  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
17537  __Pyx_GOTREF(__pyx_t_1);
17538  __pyx_r = __pyx_t_1;
17539  __pyx_t_1 = 0;
17540  goto __pyx_L0;
17541 
17542  /* "View.MemoryView":588
17543  *
17544  * @property
17545  * def itemsize(self): # <<<<<<<<<<<<<<
17546  * return self.view.itemsize
17547  *
17548  */
17549 
17550  /* function exit code */
17551  __pyx_L1_error:;
17552  __Pyx_XDECREF(__pyx_t_1);
17553  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17554  __pyx_r = NULL;
17555  __pyx_L0:;
17556  __Pyx_XGIVEREF(__pyx_r);
17557  __Pyx_TraceReturn(__pyx_r, 0);
17558  __Pyx_RefNannyFinishContext();
17559  return __pyx_r;
17560 }
17561 
17562 /* "View.MemoryView":592
17563  *
17564  * @property
17565  * def nbytes(self): # <<<<<<<<<<<<<<
17566  * return self.size * self.view.itemsize
17567  *
17568  */
17569 
17570 /* Python wrapper */
17571 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
17572 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
17573  PyObject *__pyx_r = 0;
17574  __Pyx_RefNannyDeclarations
17575  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17576  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17577 
17578  /* function exit code */
17579  __Pyx_RefNannyFinishContext();
17580  return __pyx_r;
17581 }
17582 
17583 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17584  PyObject *__pyx_r = NULL;
17585  __Pyx_TraceDeclarations
17586  __Pyx_RefNannyDeclarations
17587  PyObject *__pyx_t_1 = NULL;
17588  PyObject *__pyx_t_2 = NULL;
17589  PyObject *__pyx_t_3 = NULL;
17590  int __pyx_lineno = 0;
17591  const char *__pyx_filename = NULL;
17592  int __pyx_clineno = 0;
17593  __Pyx_RefNannySetupContext("__get__", 0);
17594  __Pyx_TraceCall("__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
17595 
17596  /* "View.MemoryView":593
17597  * @property
17598  * def nbytes(self):
17599  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
17600  *
17601  * @property
17602  */
17603  __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
17604  __Pyx_XDECREF(__pyx_r);
17605  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
17606  __Pyx_GOTREF(__pyx_t_1);
17607  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
17608  __Pyx_GOTREF(__pyx_t_2);
17609  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
17610  __Pyx_GOTREF(__pyx_t_3);
17611  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17612  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17613  __pyx_r = __pyx_t_3;
17614  __pyx_t_3 = 0;
17615  goto __pyx_L0;
17616 
17617  /* "View.MemoryView":592
17618  *
17619  * @property
17620  * def nbytes(self): # <<<<<<<<<<<<<<
17621  * return self.size * self.view.itemsize
17622  *
17623  */
17624 
17625  /* function exit code */
17626  __pyx_L1_error:;
17627  __Pyx_XDECREF(__pyx_t_1);
17628  __Pyx_XDECREF(__pyx_t_2);
17629  __Pyx_XDECREF(__pyx_t_3);
17630  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17631  __pyx_r = NULL;
17632  __pyx_L0:;
17633  __Pyx_XGIVEREF(__pyx_r);
17634  __Pyx_TraceReturn(__pyx_r, 0);
17635  __Pyx_RefNannyFinishContext();
17636  return __pyx_r;
17637 }
17638 
17639 /* "View.MemoryView":596
17640  *
17641  * @property
17642  * def size(self): # <<<<<<<<<<<<<<
17643  * if self._size is None:
17644  * result = 1
17645  */
17646 
17647 /* Python wrapper */
17648 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
17649 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
17650  PyObject *__pyx_r = 0;
17651  __Pyx_RefNannyDeclarations
17652  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17653  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17654 
17655  /* function exit code */
17656  __Pyx_RefNannyFinishContext();
17657  return __pyx_r;
17658 }
17659 
17660 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17661  PyObject *__pyx_v_result = NULL;
17662  PyObject *__pyx_v_length = NULL;
17663  PyObject *__pyx_r = NULL;
17664  __Pyx_TraceDeclarations
17665  __Pyx_RefNannyDeclarations
17666  int __pyx_t_1;
17667  int __pyx_t_2;
17668  Py_ssize_t *__pyx_t_3;
17669  Py_ssize_t *__pyx_t_4;
17670  Py_ssize_t *__pyx_t_5;
17671  PyObject *__pyx_t_6 = NULL;
17672  int __pyx_lineno = 0;
17673  const char *__pyx_filename = NULL;
17674  int __pyx_clineno = 0;
17675  __Pyx_RefNannySetupContext("__get__", 0);
17676  __Pyx_TraceCall("__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
17677 
17678  /* "View.MemoryView":597
17679  * @property
17680  * def size(self):
17681  * if self._size is None: # <<<<<<<<<<<<<<
17682  * result = 1
17683  *
17684  */
17685  __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
17686  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
17687  __pyx_t_2 = (__pyx_t_1 != 0);
17688  if (__pyx_t_2) {
17689 
17690  /* "View.MemoryView":598
17691  * def size(self):
17692  * if self._size is None:
17693  * result = 1 # <<<<<<<<<<<<<<
17694  *
17695  * for length in self.view.shape[:self.view.ndim]:
17696  */
17697  __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
17698  __Pyx_INCREF(__pyx_int_1);
17699  __pyx_v_result = __pyx_int_1;
17700 
17701  /* "View.MemoryView":600
17702  * result = 1
17703  *
17704  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
17705  * result *= length
17706  *
17707  */
17708  __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
17709  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
17710  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17711  __pyx_t_3 = __pyx_t_5;
17712  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
17713  __Pyx_GOTREF(__pyx_t_6);
17714  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
17715  __pyx_t_6 = 0;
17716 
17717  /* "View.MemoryView":601
17718  *
17719  * for length in self.view.shape[:self.view.ndim]:
17720  * result *= length # <<<<<<<<<<<<<<
17721  *
17722  * self._size = result
17723  */
17724  __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
17725  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
17726  __Pyx_GOTREF(__pyx_t_6);
17727  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
17728  __pyx_t_6 = 0;
17729  }
17730 
17731  /* "View.MemoryView":603
17732  * result *= length
17733  *
17734  * self._size = result # <<<<<<<<<<<<<<
17735  *
17736  * return self._size
17737  */
17738  __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
17739  __Pyx_INCREF(__pyx_v_result);
17740  __Pyx_GIVEREF(__pyx_v_result);
17741  __Pyx_GOTREF(__pyx_v_self->_size);
17742  __Pyx_DECREF(__pyx_v_self->_size);
17743  __pyx_v_self->_size = __pyx_v_result;
17744 
17745  /* "View.MemoryView":597
17746  * @property
17747  * def size(self):
17748  * if self._size is None: # <<<<<<<<<<<<<<
17749  * result = 1
17750  *
17751  */
17752  }
17753 
17754  /* "View.MemoryView":605
17755  * self._size = result
17756  *
17757  * return self._size # <<<<<<<<<<<<<<
17758  *
17759  * def __len__(self):
17760  */
17761  __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
17762  __Pyx_XDECREF(__pyx_r);
17763  __Pyx_INCREF(__pyx_v_self->_size);
17764  __pyx_r = __pyx_v_self->_size;
17765  goto __pyx_L0;
17766 
17767  /* "View.MemoryView":596
17768  *
17769  * @property
17770  * def size(self): # <<<<<<<<<<<<<<
17771  * if self._size is None:
17772  * result = 1
17773  */
17774 
17775  /* function exit code */
17776  __pyx_L1_error:;
17777  __Pyx_XDECREF(__pyx_t_6);
17778  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17779  __pyx_r = NULL;
17780  __pyx_L0:;
17781  __Pyx_XDECREF(__pyx_v_result);
17782  __Pyx_XDECREF(__pyx_v_length);
17783  __Pyx_XGIVEREF(__pyx_r);
17784  __Pyx_TraceReturn(__pyx_r, 0);
17785  __Pyx_RefNannyFinishContext();
17786  return __pyx_r;
17787 }
17788 
17789 /* "View.MemoryView":607
17790  * return self._size
17791  *
17792  * def __len__(self): # <<<<<<<<<<<<<<
17793  * if self.view.ndim >= 1:
17794  * return self.view.shape[0]
17795  */
17796 
17797 /* Python wrapper */
17798 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
17799 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
17800  Py_ssize_t __pyx_r;
17801  __Pyx_RefNannyDeclarations
17802  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
17803  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17804 
17805  /* function exit code */
17806  __Pyx_RefNannyFinishContext();
17807  return __pyx_r;
17808 }
17809 
17810 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
17811  Py_ssize_t __pyx_r;
17812  __Pyx_TraceDeclarations
17813  __Pyx_RefNannyDeclarations
17814  int __pyx_t_1;
17815  int __pyx_lineno = 0;
17816  const char *__pyx_filename = NULL;
17817  int __pyx_clineno = 0;
17818  __Pyx_RefNannySetupContext("__len__", 0);
17819  __Pyx_TraceCall("__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
17820 
17821  /* "View.MemoryView":608
17822  *
17823  * def __len__(self):
17824  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
17825  * return self.view.shape[0]
17826  *
17827  */
17828  __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
17829  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
17830  if (__pyx_t_1) {
17831 
17832  /* "View.MemoryView":609
17833  * def __len__(self):
17834  * if self.view.ndim >= 1:
17835  * return self.view.shape[0] # <<<<<<<<<<<<<<
17836  *
17837  * return 0
17838  */
17839  __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
17840  __pyx_r = (__pyx_v_self->view.shape[0]);
17841  goto __pyx_L0;
17842 
17843  /* "View.MemoryView":608
17844  *
17845  * def __len__(self):
17846  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
17847  * return self.view.shape[0]
17848  *
17849  */
17850  }
17851 
17852  /* "View.MemoryView":611
17853  * return self.view.shape[0]
17854  *
17855  * return 0 # <<<<<<<<<<<<<<
17856  *
17857  * def __repr__(self):
17858  */
17859  __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
17860  __pyx_r = 0;
17861  goto __pyx_L0;
17862 
17863  /* "View.MemoryView":607
17864  * return self._size
17865  *
17866  * def __len__(self): # <<<<<<<<<<<<<<
17867  * if self.view.ndim >= 1:
17868  * return self.view.shape[0]
17869  */
17870 
17871  /* function exit code */
17872  __pyx_L1_error:;
17873  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17874  __pyx_r = -1;
17875  __pyx_L0:;
17876  __Pyx_TraceReturn(Py_None, 0);
17877  __Pyx_RefNannyFinishContext();
17878  return __pyx_r;
17879 }
17880 
17881 /* "View.MemoryView":613
17882  * return 0
17883  *
17884  * def __repr__(self): # <<<<<<<<<<<<<<
17885  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
17886  * id(self))
17887  */
17888 
17889 /* Python wrapper */
17890 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
17891 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
17892  PyObject *__pyx_r = 0;
17893  __Pyx_RefNannyDeclarations
17894  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
17895  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17896 
17897  /* function exit code */
17898  __Pyx_RefNannyFinishContext();
17899  return __pyx_r;
17900 }
17901 
17902 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
17903  PyObject *__pyx_r = NULL;
17904  __Pyx_TraceDeclarations
17905  __Pyx_RefNannyDeclarations
17906  PyObject *__pyx_t_1 = NULL;
17907  PyObject *__pyx_t_2 = NULL;
17908  PyObject *__pyx_t_3 = NULL;
17909  int __pyx_lineno = 0;
17910  const char *__pyx_filename = NULL;
17911  int __pyx_clineno = 0;
17912  __Pyx_RefNannySetupContext("__repr__", 0);
17913  __Pyx_TraceCall("__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
17914 
17915  /* "View.MemoryView":614
17916  *
17917  * def __repr__(self):
17918  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
17919  * id(self))
17920  *
17921  */
17922  __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
17923  __Pyx_XDECREF(__pyx_r);
17924  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
17925  __Pyx_GOTREF(__pyx_t_1);
17926  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
17927  __Pyx_GOTREF(__pyx_t_2);
17928  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17929  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
17930  __Pyx_GOTREF(__pyx_t_1);
17931  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17932 
17933  /* "View.MemoryView":615
17934  * def __repr__(self):
17935  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
17936  * id(self)) # <<<<<<<<<<<<<<
17937  *
17938  * def __str__(self):
17939  */
17940  __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
17941  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
17942  __Pyx_GOTREF(__pyx_t_2);
17943 
17944  /* "View.MemoryView":614
17945  *
17946  * def __repr__(self):
17947  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
17948  * id(self))
17949  *
17950  */
17951  __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
17952  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
17953  __Pyx_GOTREF(__pyx_t_3);
17954  __Pyx_GIVEREF(__pyx_t_1);
17955  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
17956  __Pyx_GIVEREF(__pyx_t_2);
17957  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
17958  __pyx_t_1 = 0;
17959  __pyx_t_2 = 0;
17960  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
17961  __Pyx_GOTREF(__pyx_t_2);
17962  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17963  __pyx_r = __pyx_t_2;
17964  __pyx_t_2 = 0;
17965  goto __pyx_L0;
17966 
17967  /* "View.MemoryView":613
17968  * return 0
17969  *
17970  * def __repr__(self): # <<<<<<<<<<<<<<
17971  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
17972  * id(self))
17973  */
17974 
17975  /* function exit code */
17976  __pyx_L1_error:;
17977  __Pyx_XDECREF(__pyx_t_1);
17978  __Pyx_XDECREF(__pyx_t_2);
17979  __Pyx_XDECREF(__pyx_t_3);
17980  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17981  __pyx_r = NULL;
17982  __pyx_L0:;
17983  __Pyx_XGIVEREF(__pyx_r);
17984  __Pyx_TraceReturn(__pyx_r, 0);
17985  __Pyx_RefNannyFinishContext();
17986  return __pyx_r;
17987 }
17988 
17989 /* "View.MemoryView":617
17990  * id(self))
17991  *
17992  * def __str__(self): # <<<<<<<<<<<<<<
17993  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
17994  *
17995  */
17996 
17997 /* Python wrapper */
17998 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
17999 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
18000  PyObject *__pyx_r = 0;
18001  __Pyx_RefNannyDeclarations
18002  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
18003  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18004 
18005  /* function exit code */
18006  __Pyx_RefNannyFinishContext();
18007  return __pyx_r;
18008 }
18009 
18010 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
18011  PyObject *__pyx_r = NULL;
18012  __Pyx_TraceDeclarations
18013  __Pyx_RefNannyDeclarations
18014  PyObject *__pyx_t_1 = NULL;
18015  PyObject *__pyx_t_2 = NULL;
18016  int __pyx_lineno = 0;
18017  const char *__pyx_filename = NULL;
18018  int __pyx_clineno = 0;
18019  __Pyx_RefNannySetupContext("__str__", 0);
18020  __Pyx_TraceCall("__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
18021 
18022  /* "View.MemoryView":618
18023  *
18024  * def __str__(self):
18025  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
18026  *
18027  *
18028  */
18029  __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
18030  __Pyx_XDECREF(__pyx_r);
18031  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
18032  __Pyx_GOTREF(__pyx_t_1);
18033  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
18034  __Pyx_GOTREF(__pyx_t_2);
18035  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18036  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
18037  __Pyx_GOTREF(__pyx_t_1);
18038  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18039  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
18040  __Pyx_GOTREF(__pyx_t_2);
18041  __Pyx_GIVEREF(__pyx_t_1);
18042  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
18043  __pyx_t_1 = 0;
18044  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
18045  __Pyx_GOTREF(__pyx_t_1);
18046  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18047  __pyx_r = __pyx_t_1;
18048  __pyx_t_1 = 0;
18049  goto __pyx_L0;
18050 
18051  /* "View.MemoryView":617
18052  * id(self))
18053  *
18054  * def __str__(self): # <<<<<<<<<<<<<<
18055  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
18056  *
18057  */
18058 
18059  /* function exit code */
18060  __pyx_L1_error:;
18061  __Pyx_XDECREF(__pyx_t_1);
18062  __Pyx_XDECREF(__pyx_t_2);
18063  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18064  __pyx_r = NULL;
18065  __pyx_L0:;
18066  __Pyx_XGIVEREF(__pyx_r);
18067  __Pyx_TraceReturn(__pyx_r, 0);
18068  __Pyx_RefNannyFinishContext();
18069  return __pyx_r;
18070 }
18071 
18072 /* "View.MemoryView":621
18073  *
18074  *
18075  * def is_c_contig(self): # <<<<<<<<<<<<<<
18076  * cdef __Pyx_memviewslice *mslice
18077  * cdef __Pyx_memviewslice tmp
18078  */
18079 
18080 /* Python wrapper */
18081 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18082 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
18083 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18084  PyObject *__pyx_r = 0;
18085  __Pyx_RefNannyDeclarations
18086  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
18087  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
18088 
18089  /* function exit code */
18090  __Pyx_RefNannyFinishContext();
18091  return __pyx_r;
18092 }
18093 
18094 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
18095  __Pyx_memviewslice *__pyx_v_mslice;
18096  __Pyx_memviewslice __pyx_v_tmp;
18097  PyObject *__pyx_r = NULL;
18098  __Pyx_TraceDeclarations
18099  __Pyx_RefNannyDeclarations
18100  __Pyx_memviewslice *__pyx_t_1;
18101  PyObject *__pyx_t_2 = NULL;
18102  int __pyx_lineno = 0;
18103  const char *__pyx_filename = NULL;
18104  int __pyx_clineno = 0;
18105  __Pyx_RefNannySetupContext("is_c_contig", 0);
18106  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
18107 
18108  /* "View.MemoryView":624
18109  * cdef __Pyx_memviewslice *mslice
18110  * cdef __Pyx_memviewslice tmp
18111  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
18112  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
18113  *
18114  */
18115  __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
18116  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
18117  __pyx_v_mslice = __pyx_t_1;
18118 
18119  /* "View.MemoryView":625
18120  * cdef __Pyx_memviewslice tmp
18121  * mslice = get_slice_from_memview(self, &tmp)
18122  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
18123  *
18124  * def is_f_contig(self):
18125  */
18126  __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
18127  __Pyx_XDECREF(__pyx_r);
18128  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
18129  __Pyx_GOTREF(__pyx_t_2);
18130  __pyx_r = __pyx_t_2;
18131  __pyx_t_2 = 0;
18132  goto __pyx_L0;
18133 
18134  /* "View.MemoryView":621
18135  *
18136  *
18137  * def is_c_contig(self): # <<<<<<<<<<<<<<
18138  * cdef __Pyx_memviewslice *mslice
18139  * cdef __Pyx_memviewslice tmp
18140  */
18141 
18142  /* function exit code */
18143  __pyx_L1_error:;
18144  __Pyx_XDECREF(__pyx_t_2);
18145  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
18146  __pyx_r = NULL;
18147  __pyx_L0:;
18148  __Pyx_XGIVEREF(__pyx_r);
18149  __Pyx_TraceReturn(__pyx_r, 0);
18150  __Pyx_RefNannyFinishContext();
18151  return __pyx_r;
18152 }
18153 
18154 /* "View.MemoryView":627
18155  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
18156  *
18157  * def is_f_contig(self): # <<<<<<<<<<<<<<
18158  * cdef __Pyx_memviewslice *mslice
18159  * cdef __Pyx_memviewslice tmp
18160  */
18161 
18162 /* Python wrapper */
18163 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18164 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
18165 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18166  PyObject *__pyx_r = 0;
18167  __Pyx_RefNannyDeclarations
18168  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
18169  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
18170 
18171  /* function exit code */
18172  __Pyx_RefNannyFinishContext();
18173  return __pyx_r;
18174 }
18175 
18176 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
18177  __Pyx_memviewslice *__pyx_v_mslice;
18178  __Pyx_memviewslice __pyx_v_tmp;
18179  PyObject *__pyx_r = NULL;
18180  __Pyx_TraceDeclarations
18181  __Pyx_RefNannyDeclarations
18182  __Pyx_memviewslice *__pyx_t_1;
18183  PyObject *__pyx_t_2 = NULL;
18184  int __pyx_lineno = 0;
18185  const char *__pyx_filename = NULL;
18186  int __pyx_clineno = 0;
18187  __Pyx_RefNannySetupContext("is_f_contig", 0);
18188  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
18189 
18190  /* "View.MemoryView":630
18191  * cdef __Pyx_memviewslice *mslice
18192  * cdef __Pyx_memviewslice tmp
18193  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
18194  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
18195  *
18196  */
18197  __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
18198  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
18199  __pyx_v_mslice = __pyx_t_1;
18200 
18201  /* "View.MemoryView":631
18202  * cdef __Pyx_memviewslice tmp
18203  * mslice = get_slice_from_memview(self, &tmp)
18204  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
18205  *
18206  * def copy(self):
18207  */
18208  __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
18209  __Pyx_XDECREF(__pyx_r);
18210  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
18211  __Pyx_GOTREF(__pyx_t_2);
18212  __pyx_r = __pyx_t_2;
18213  __pyx_t_2 = 0;
18214  goto __pyx_L0;
18215 
18216  /* "View.MemoryView":627
18217  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
18218  *
18219  * def is_f_contig(self): # <<<<<<<<<<<<<<
18220  * cdef __Pyx_memviewslice *mslice
18221  * cdef __Pyx_memviewslice tmp
18222  */
18223 
18224  /* function exit code */
18225  __pyx_L1_error:;
18226  __Pyx_XDECREF(__pyx_t_2);
18227  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
18228  __pyx_r = NULL;
18229  __pyx_L0:;
18230  __Pyx_XGIVEREF(__pyx_r);
18231  __Pyx_TraceReturn(__pyx_r, 0);
18232  __Pyx_RefNannyFinishContext();
18233  return __pyx_r;
18234 }
18235 
18236 /* "View.MemoryView":633
18237  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
18238  *
18239  * def copy(self): # <<<<<<<<<<<<<<
18240  * cdef __Pyx_memviewslice mslice
18241  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
18242  */
18243 
18244 /* Python wrapper */
18245 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18246 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
18247 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18248  PyObject *__pyx_r = 0;
18249  __Pyx_RefNannyDeclarations
18250  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
18251  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
18252 
18253  /* function exit code */
18254  __Pyx_RefNannyFinishContext();
18255  return __pyx_r;
18256 }
18257 
18258 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
18259  __Pyx_memviewslice __pyx_v_mslice;
18260  int __pyx_v_flags;
18261  PyObject *__pyx_r = NULL;
18262  __Pyx_TraceDeclarations
18263  __Pyx_RefNannyDeclarations
18264  __Pyx_memviewslice __pyx_t_1;
18265  PyObject *__pyx_t_2 = NULL;
18266  int __pyx_lineno = 0;
18267  const char *__pyx_filename = NULL;
18268  int __pyx_clineno = 0;
18269  __Pyx_RefNannySetupContext("copy", 0);
18270  __Pyx_TraceCall("copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
18271 
18272  /* "View.MemoryView":635
18273  * def copy(self):
18274  * cdef __Pyx_memviewslice mslice
18275  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
18276  *
18277  * slice_copy(self, &mslice)
18278  */
18279  __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
18280  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
18281 
18282  /* "View.MemoryView":637
18283  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
18284  *
18285  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
18286  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
18287  * self.view.itemsize,
18288  */
18289  __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
18290  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
18291 
18292  /* "View.MemoryView":638
18293  *
18294  * slice_copy(self, &mslice)
18295  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
18296  * self.view.itemsize,
18297  * flags|PyBUF_C_CONTIGUOUS,
18298  */
18299  __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
18300  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
18301  __pyx_v_mslice = __pyx_t_1;
18302 
18303  /* "View.MemoryView":643
18304  * self.dtype_is_object)
18305  *
18306  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
18307  *
18308  * def copy_fortran(self):
18309  */
18310  __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
18311  __Pyx_XDECREF(__pyx_r);
18312  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
18313  __Pyx_GOTREF(__pyx_t_2);
18314  __pyx_r = __pyx_t_2;
18315  __pyx_t_2 = 0;
18316  goto __pyx_L0;
18317 
18318  /* "View.MemoryView":633
18319  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
18320  *
18321  * def copy(self): # <<<<<<<<<<<<<<
18322  * cdef __Pyx_memviewslice mslice
18323  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
18324  */
18325 
18326  /* function exit code */
18327  __pyx_L1_error:;
18328  __Pyx_XDECREF(__pyx_t_2);
18329  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18330  __pyx_r = NULL;
18331  __pyx_L0:;
18332  __Pyx_XGIVEREF(__pyx_r);
18333  __Pyx_TraceReturn(__pyx_r, 0);
18334  __Pyx_RefNannyFinishContext();
18335  return __pyx_r;
18336 }
18337 
18338 /* "View.MemoryView":645
18339  * return memoryview_copy_from_slice(self, &mslice)
18340  *
18341  * def copy_fortran(self): # <<<<<<<<<<<<<<
18342  * cdef __Pyx_memviewslice src, dst
18343  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
18344  */
18345 
18346 /* Python wrapper */
18347 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18348 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
18349 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18350  PyObject *__pyx_r = 0;
18351  __Pyx_RefNannyDeclarations
18352  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
18353  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
18354 
18355  /* function exit code */
18356  __Pyx_RefNannyFinishContext();
18357  return __pyx_r;
18358 }
18359 
18360 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
18361  __Pyx_memviewslice __pyx_v_src;
18362  __Pyx_memviewslice __pyx_v_dst;
18363  int __pyx_v_flags;
18364  PyObject *__pyx_r = NULL;
18365  __Pyx_TraceDeclarations
18366  __Pyx_RefNannyDeclarations
18367  __Pyx_memviewslice __pyx_t_1;
18368  PyObject *__pyx_t_2 = NULL;
18369  int __pyx_lineno = 0;
18370  const char *__pyx_filename = NULL;
18371  int __pyx_clineno = 0;
18372  __Pyx_RefNannySetupContext("copy_fortran", 0);
18373  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
18374 
18375  /* "View.MemoryView":647
18376  * def copy_fortran(self):
18377  * cdef __Pyx_memviewslice src, dst
18378  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
18379  *
18380  * slice_copy(self, &src)
18381  */
18382  __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
18383  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
18384 
18385  /* "View.MemoryView":649
18386  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
18387  *
18388  * slice_copy(self, &src) # <<<<<<<<<<<<<<
18389  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
18390  * self.view.itemsize,
18391  */
18392  __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
18393  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
18394 
18395  /* "View.MemoryView":650
18396  *
18397  * slice_copy(self, &src)
18398  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
18399  * self.view.itemsize,
18400  * flags|PyBUF_F_CONTIGUOUS,
18401  */
18402  __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
18403  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
18404  __pyx_v_dst = __pyx_t_1;
18405 
18406  /* "View.MemoryView":655
18407  * self.dtype_is_object)
18408  *
18409  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
18410  *
18411  *
18412  */
18413  __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
18414  __Pyx_XDECREF(__pyx_r);
18415  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
18416  __Pyx_GOTREF(__pyx_t_2);
18417  __pyx_r = __pyx_t_2;
18418  __pyx_t_2 = 0;
18419  goto __pyx_L0;
18420 
18421  /* "View.MemoryView":645
18422  * return memoryview_copy_from_slice(self, &mslice)
18423  *
18424  * def copy_fortran(self): # <<<<<<<<<<<<<<
18425  * cdef __Pyx_memviewslice src, dst
18426  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
18427  */
18428 
18429  /* function exit code */
18430  __pyx_L1_error:;
18431  __Pyx_XDECREF(__pyx_t_2);
18432  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
18433  __pyx_r = NULL;
18434  __pyx_L0:;
18435  __Pyx_XGIVEREF(__pyx_r);
18436  __Pyx_TraceReturn(__pyx_r, 0);
18437  __Pyx_RefNannyFinishContext();
18438  return __pyx_r;
18439 }
18440 
18441 /* "(tree fragment)":1
18442  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18443  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18444  * def __setstate_cython__(self, __pyx_state):
18445  */
18446 
18447 /* Python wrapper */
18448 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18449 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
18450 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18451  PyObject *__pyx_r = 0;
18452  __Pyx_RefNannyDeclarations
18453  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18454  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18455 
18456  /* function exit code */
18457  __Pyx_RefNannyFinishContext();
18458  return __pyx_r;
18459 }
18460 
18461 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
18462  PyObject *__pyx_r = NULL;
18463  __Pyx_TraceDeclarations
18464  __Pyx_RefNannyDeclarations
18465  PyObject *__pyx_t_1 = NULL;
18466  int __pyx_lineno = 0;
18467  const char *__pyx_filename = NULL;
18468  int __pyx_clineno = 0;
18469  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18470  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
18471 
18472  /* "(tree fragment)":2
18473  * def __reduce_cython__(self):
18474  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18475  * def __setstate_cython__(self, __pyx_state):
18476  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18477  */
18478  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
18479  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18480  __Pyx_GOTREF(__pyx_t_1);
18481  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18482  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18483  __PYX_ERR(1, 2, __pyx_L1_error)
18484 
18485  /* "(tree fragment)":1
18486  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18487  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18488  * def __setstate_cython__(self, __pyx_state):
18489  */
18490 
18491  /* function exit code */
18492  __pyx_L1_error:;
18493  __Pyx_XDECREF(__pyx_t_1);
18494  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18495  __pyx_r = NULL;
18496  __Pyx_XGIVEREF(__pyx_r);
18497  __Pyx_TraceReturn(__pyx_r, 0);
18498  __Pyx_RefNannyFinishContext();
18499  return __pyx_r;
18500 }
18501 
18502 /* "(tree fragment)":3
18503  * def __reduce_cython__(self):
18504  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18505  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18506  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18507  */
18508 
18509 /* Python wrapper */
18510 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
18511 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
18512 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18513  PyObject *__pyx_r = 0;
18514  __Pyx_RefNannyDeclarations
18515  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18516  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18517 
18518  /* function exit code */
18519  __Pyx_RefNannyFinishContext();
18520  return __pyx_r;
18521 }
18522 
18523 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18524  PyObject *__pyx_r = NULL;
18525  __Pyx_TraceDeclarations
18526  __Pyx_RefNannyDeclarations
18527  PyObject *__pyx_t_1 = NULL;
18528  int __pyx_lineno = 0;
18529  const char *__pyx_filename = NULL;
18530  int __pyx_clineno = 0;
18531  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18532  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
18533 
18534  /* "(tree fragment)":4
18535  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18536  * def __setstate_cython__(self, __pyx_state):
18537  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18538  */
18539  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
18540  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18541  __Pyx_GOTREF(__pyx_t_1);
18542  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18543  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18544  __PYX_ERR(1, 4, __pyx_L1_error)
18545 
18546  /* "(tree fragment)":3
18547  * def __reduce_cython__(self):
18548  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18549  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18550  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18551  */
18552 
18553  /* function exit code */
18554  __pyx_L1_error:;
18555  __Pyx_XDECREF(__pyx_t_1);
18556  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18557  __pyx_r = NULL;
18558  __Pyx_XGIVEREF(__pyx_r);
18559  __Pyx_TraceReturn(__pyx_r, 0);
18560  __Pyx_RefNannyFinishContext();
18561  return __pyx_r;
18562 }
18563 
18564 /* "View.MemoryView":659
18565  *
18566  * @cname('__pyx_memoryview_new')
18567  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
18568  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
18569  * result.typeinfo = typeinfo
18570  */
18571 
18572 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
18573  struct __pyx_memoryview_obj *__pyx_v_result = 0;
18574  PyObject *__pyx_r = NULL;
18575  __Pyx_TraceDeclarations
18576  __Pyx_RefNannyDeclarations
18577  PyObject *__pyx_t_1 = NULL;
18578  PyObject *__pyx_t_2 = NULL;
18579  PyObject *__pyx_t_3 = NULL;
18580  int __pyx_lineno = 0;
18581  const char *__pyx_filename = NULL;
18582  int __pyx_clineno = 0;
18583  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
18584  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
18585 
18586  /* "View.MemoryView":660
18587  * @cname('__pyx_memoryview_new')
18588  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
18589  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
18590  * result.typeinfo = typeinfo
18591  * return result
18592  */
18593  __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
18594  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
18595  __Pyx_GOTREF(__pyx_t_1);
18596  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
18597  __Pyx_GOTREF(__pyx_t_2);
18598  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
18599  __Pyx_GOTREF(__pyx_t_3);
18600  __Pyx_INCREF(__pyx_v_o);
18601  __Pyx_GIVEREF(__pyx_v_o);
18602  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
18603  __Pyx_GIVEREF(__pyx_t_1);
18604  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
18605  __Pyx_GIVEREF(__pyx_t_2);
18606  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18607  __pyx_t_1 = 0;
18608  __pyx_t_2 = 0;
18609  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
18610  __Pyx_GOTREF(__pyx_t_2);
18611  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18612  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
18613  __pyx_t_2 = 0;
18614 
18615  /* "View.MemoryView":661
18616  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
18617  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
18618  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
18619  * return result
18620  *
18621  */
18622  __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
18623  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
18624 
18625  /* "View.MemoryView":662
18626  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
18627  * result.typeinfo = typeinfo
18628  * return result # <<<<<<<<<<<<<<
18629  *
18630  * @cname('__pyx_memoryview_check')
18631  */
18632  __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
18633  __Pyx_XDECREF(__pyx_r);
18634  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18635  __pyx_r = ((PyObject *)__pyx_v_result);
18636  goto __pyx_L0;
18637 
18638  /* "View.MemoryView":659
18639  *
18640  * @cname('__pyx_memoryview_new')
18641  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
18642  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
18643  * result.typeinfo = typeinfo
18644  */
18645 
18646  /* function exit code */
18647  __pyx_L1_error:;
18648  __Pyx_XDECREF(__pyx_t_1);
18649  __Pyx_XDECREF(__pyx_t_2);
18650  __Pyx_XDECREF(__pyx_t_3);
18651  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
18652  __pyx_r = 0;
18653  __pyx_L0:;
18654  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18655  __Pyx_XGIVEREF(__pyx_r);
18656  __Pyx_TraceReturn(__pyx_r, 0);
18657  __Pyx_RefNannyFinishContext();
18658  return __pyx_r;
18659 }
18660 
18661 /* "View.MemoryView":665
18662  *
18663  * @cname('__pyx_memoryview_check')
18664  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
18665  * return isinstance(o, memoryview)
18666  *
18667  */
18668 
18669 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
18670  int __pyx_r;
18671  __Pyx_TraceDeclarations
18672  __Pyx_RefNannyDeclarations
18673  int __pyx_t_1;
18674  int __pyx_lineno = 0;
18675  const char *__pyx_filename = NULL;
18676  int __pyx_clineno = 0;
18677  __Pyx_RefNannySetupContext("memoryview_check", 0);
18678  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
18679 
18680  /* "View.MemoryView":666
18681  * @cname('__pyx_memoryview_check')
18682  * cdef inline bint memoryview_check(object o):
18683  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
18684  *
18685  * cdef tuple _unellipsify(object index, int ndim):
18686  */
18687  __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
18688  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
18689  __pyx_r = __pyx_t_1;
18690  goto __pyx_L0;
18691 
18692  /* "View.MemoryView":665
18693  *
18694  * @cname('__pyx_memoryview_check')
18695  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
18696  * return isinstance(o, memoryview)
18697  *
18698  */
18699 
18700  /* function exit code */
18701  __pyx_L1_error:;
18702  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18703  __pyx_r = 0;
18704  __pyx_L0:;
18705  __Pyx_TraceReturn(Py_None, 0);
18706  __Pyx_RefNannyFinishContext();
18707  return __pyx_r;
18708 }
18709 
18710 /* "View.MemoryView":668
18711  * return isinstance(o, memoryview)
18712  *
18713  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
18714  * """
18715  * Replace all ellipses with full slices and fill incomplete indices with
18716  */
18717 
18718 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
18719  PyObject *__pyx_v_tup = NULL;
18720  PyObject *__pyx_v_result = NULL;
18721  int __pyx_v_have_slices;
18722  int __pyx_v_seen_ellipsis;
18723  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
18724  PyObject *__pyx_v_item = NULL;
18725  Py_ssize_t __pyx_v_nslices;
18726  PyObject *__pyx_r = NULL;
18727  __Pyx_TraceDeclarations
18728  __Pyx_RefNannyDeclarations
18729  int __pyx_t_1;
18730  int __pyx_t_2;
18731  PyObject *__pyx_t_3 = NULL;
18732  PyObject *__pyx_t_4 = NULL;
18733  Py_ssize_t __pyx_t_5;
18734  PyObject *(*__pyx_t_6)(PyObject *);
18735  PyObject *__pyx_t_7 = NULL;
18736  Py_ssize_t __pyx_t_8;
18737  int __pyx_t_9;
18738  int __pyx_t_10;
18739  PyObject *__pyx_t_11 = NULL;
18740  int __pyx_lineno = 0;
18741  const char *__pyx_filename = NULL;
18742  int __pyx_clineno = 0;
18743  __Pyx_RefNannySetupContext("_unellipsify", 0);
18744  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
18745 
18746  /* "View.MemoryView":673
18747  * full slices.
18748  * """
18749  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
18750  * tup = (index,)
18751  * else:
18752  */
18753  __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
18754  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
18755  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
18756  if (__pyx_t_2) {
18757 
18758  /* "View.MemoryView":674
18759  * """
18760  * if not isinstance(index, tuple):
18761  * tup = (index,) # <<<<<<<<<<<<<<
18762  * else:
18763  * tup = index
18764  */
18765  __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
18766  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
18767  __Pyx_GOTREF(__pyx_t_3);
18768  __Pyx_INCREF(__pyx_v_index);
18769  __Pyx_GIVEREF(__pyx_v_index);
18770  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
18771  __pyx_v_tup = __pyx_t_3;
18772  __pyx_t_3 = 0;
18773 
18774  /* "View.MemoryView":673
18775  * full slices.
18776  * """
18777  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
18778  * tup = (index,)
18779  * else:
18780  */
18781  goto __pyx_L3;
18782  }
18783 
18784  /* "View.MemoryView":676
18785  * tup = (index,)
18786  * else:
18787  * tup = index # <<<<<<<<<<<<<<
18788  *
18789  * result = []
18790  */
18791  __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
18792  /*else*/ {
18793  __Pyx_INCREF(__pyx_v_index);
18794  __pyx_v_tup = __pyx_v_index;
18795  }
18796  __pyx_L3:;
18797 
18798  /* "View.MemoryView":678
18799  * tup = index
18800  *
18801  * result = [] # <<<<<<<<<<<<<<
18802  * have_slices = False
18803  * seen_ellipsis = False
18804  */
18805  __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
18806  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
18807  __Pyx_GOTREF(__pyx_t_3);
18808  __pyx_v_result = ((PyObject*)__pyx_t_3);
18809  __pyx_t_3 = 0;
18810 
18811  /* "View.MemoryView":679
18812  *
18813  * result = []
18814  * have_slices = False # <<<<<<<<<<<<<<
18815  * seen_ellipsis = False
18816  * for idx, item in enumerate(tup):
18817  */
18818  __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
18819  __pyx_v_have_slices = 0;
18820 
18821  /* "View.MemoryView":680
18822  * result = []
18823  * have_slices = False
18824  * seen_ellipsis = False # <<<<<<<<<<<<<<
18825  * for idx, item in enumerate(tup):
18826  * if item is Ellipsis:
18827  */
18828  __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
18829  __pyx_v_seen_ellipsis = 0;
18830 
18831  /* "View.MemoryView":681
18832  * have_slices = False
18833  * seen_ellipsis = False
18834  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
18835  * if item is Ellipsis:
18836  * if not seen_ellipsis:
18837  */
18838  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
18839  __Pyx_INCREF(__pyx_int_0);
18840  __pyx_t_3 = __pyx_int_0;
18841  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
18842  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
18843  __pyx_t_6 = NULL;
18844  } else {
18845  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
18846  __Pyx_GOTREF(__pyx_t_4);
18847  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
18848  }
18849  for (;;) {
18850  if (likely(!__pyx_t_6)) {
18851  if (likely(PyList_CheckExact(__pyx_t_4))) {
18852  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
18853  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18854  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
18855  #else
18856  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
18857  __Pyx_GOTREF(__pyx_t_7);
18858  #endif
18859  } else {
18860  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
18861  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18862  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
18863  #else
18864  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
18865  __Pyx_GOTREF(__pyx_t_7);
18866  #endif
18867  }
18868  } else {
18869  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
18870  if (unlikely(!__pyx_t_7)) {
18871  PyObject* exc_type = PyErr_Occurred();
18872  if (exc_type) {
18873  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18874  else __PYX_ERR(1, 681, __pyx_L1_error)
18875  }
18876  break;
18877  }
18878  __Pyx_GOTREF(__pyx_t_7);
18879  }
18880  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
18881  __pyx_t_7 = 0;
18882  __Pyx_INCREF(__pyx_t_3);
18883  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
18884  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
18885  __Pyx_GOTREF(__pyx_t_7);
18886  __Pyx_DECREF(__pyx_t_3);
18887  __pyx_t_3 = __pyx_t_7;
18888  __pyx_t_7 = 0;
18889 
18890  /* "View.MemoryView":682
18891  * seen_ellipsis = False
18892  * for idx, item in enumerate(tup):
18893  * if item is Ellipsis: # <<<<<<<<<<<<<<
18894  * if not seen_ellipsis:
18895  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18896  */
18897  __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
18898  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
18899  __pyx_t_1 = (__pyx_t_2 != 0);
18900  if (__pyx_t_1) {
18901 
18902  /* "View.MemoryView":683
18903  * for idx, item in enumerate(tup):
18904  * if item is Ellipsis:
18905  * if not seen_ellipsis: # <<<<<<<<<<<<<<
18906  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18907  * seen_ellipsis = True
18908  */
18909  __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
18910  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
18911  if (__pyx_t_1) {
18912 
18913  /* "View.MemoryView":684
18914  * if item is Ellipsis:
18915  * if not seen_ellipsis:
18916  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
18917  * seen_ellipsis = True
18918  * else:
18919  */
18920  __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
18921  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
18922  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
18923  __Pyx_GOTREF(__pyx_t_7);
18924  { Py_ssize_t __pyx_temp;
18925  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
18926  __Pyx_INCREF(__pyx_slice__36);
18927  __Pyx_GIVEREF(__pyx_slice__36);
18928  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__36);
18929  }
18930  }
18931  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
18932  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18933 
18934  /* "View.MemoryView":685
18935  * if not seen_ellipsis:
18936  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18937  * seen_ellipsis = True # <<<<<<<<<<<<<<
18938  * else:
18939  * result.append(slice(None))
18940  */
18941  __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
18942  __pyx_v_seen_ellipsis = 1;
18943 
18944  /* "View.MemoryView":683
18945  * for idx, item in enumerate(tup):
18946  * if item is Ellipsis:
18947  * if not seen_ellipsis: # <<<<<<<<<<<<<<
18948  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18949  * seen_ellipsis = True
18950  */
18951  goto __pyx_L7;
18952  }
18953 
18954  /* "View.MemoryView":687
18955  * seen_ellipsis = True
18956  * else:
18957  * result.append(slice(None)) # <<<<<<<<<<<<<<
18958  * have_slices = True
18959  * else:
18960  */
18961  __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
18962  /*else*/ {
18963  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__36); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
18964  }
18965  __pyx_L7:;
18966 
18967  /* "View.MemoryView":688
18968  * else:
18969  * result.append(slice(None))
18970  * have_slices = True # <<<<<<<<<<<<<<
18971  * else:
18972  * if not isinstance(item, slice) and not PyIndex_Check(item):
18973  */
18974  __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
18975  __pyx_v_have_slices = 1;
18976 
18977  /* "View.MemoryView":682
18978  * seen_ellipsis = False
18979  * for idx, item in enumerate(tup):
18980  * if item is Ellipsis: # <<<<<<<<<<<<<<
18981  * if not seen_ellipsis:
18982  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18983  */
18984  goto __pyx_L6;
18985  }
18986 
18987  /* "View.MemoryView":690
18988  * have_slices = True
18989  * else:
18990  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
18991  * raise TypeError("Cannot index with type '%s'" % type(item))
18992  *
18993  */
18994  __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
18995  /*else*/ {
18996  __pyx_t_2 = PySlice_Check(__pyx_v_item);
18997  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
18998  if (__pyx_t_10) {
18999  } else {
19000  __pyx_t_1 = __pyx_t_10;
19001  goto __pyx_L9_bool_binop_done;
19002  }
19003  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
19004  __pyx_t_1 = __pyx_t_10;
19005  __pyx_L9_bool_binop_done:;
19006  if (unlikely(__pyx_t_1)) {
19007 
19008  /* "View.MemoryView":691
19009  * else:
19010  * if not isinstance(item, slice) and not PyIndex_Check(item):
19011  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
19012  *
19013  * have_slices = have_slices or isinstance(item, slice)
19014  */
19015  __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
19016  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
19017  __Pyx_GOTREF(__pyx_t_7);
19018  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
19019  __Pyx_GOTREF(__pyx_t_11);
19020  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19021  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
19022  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
19023  __PYX_ERR(1, 691, __pyx_L1_error)
19024 
19025  /* "View.MemoryView":690
19026  * have_slices = True
19027  * else:
19028  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
19029  * raise TypeError("Cannot index with type '%s'" % type(item))
19030  *
19031  */
19032  }
19033 
19034  /* "View.MemoryView":693
19035  * raise TypeError("Cannot index with type '%s'" % type(item))
19036  *
19037  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
19038  * result.append(item)
19039  *
19040  */
19041  __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
19042  __pyx_t_10 = (__pyx_v_have_slices != 0);
19043  if (!__pyx_t_10) {
19044  } else {
19045  __pyx_t_1 = __pyx_t_10;
19046  goto __pyx_L11_bool_binop_done;
19047  }
19048  __pyx_t_10 = PySlice_Check(__pyx_v_item);
19049  __pyx_t_2 = (__pyx_t_10 != 0);
19050  __pyx_t_1 = __pyx_t_2;
19051  __pyx_L11_bool_binop_done:;
19052  __pyx_v_have_slices = __pyx_t_1;
19053 
19054  /* "View.MemoryView":694
19055  *
19056  * have_slices = have_slices or isinstance(item, slice)
19057  * result.append(item) # <<<<<<<<<<<<<<
19058  *
19059  * nslices = ndim - len(result)
19060  */
19061  __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
19062  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
19063  }
19064  __pyx_L6:;
19065 
19066  /* "View.MemoryView":681
19067  * have_slices = False
19068  * seen_ellipsis = False
19069  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
19070  * if item is Ellipsis:
19071  * if not seen_ellipsis:
19072  */
19073  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
19074  }
19075  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19076  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19077 
19078  /* "View.MemoryView":696
19079  * result.append(item)
19080  *
19081  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
19082  * if nslices:
19083  * result.extend([slice(None)] * nslices)
19084  */
19085  __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
19086  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
19087  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
19088 
19089  /* "View.MemoryView":697
19090  *
19091  * nslices = ndim - len(result)
19092  * if nslices: # <<<<<<<<<<<<<<
19093  * result.extend([slice(None)] * nslices)
19094  *
19095  */
19096  __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
19097  __pyx_t_1 = (__pyx_v_nslices != 0);
19098  if (__pyx_t_1) {
19099 
19100  /* "View.MemoryView":698
19101  * nslices = ndim - len(result)
19102  * if nslices:
19103  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
19104  *
19105  * return have_slices or nslices, tuple(result)
19106  */
19107  __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
19108  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
19109  __Pyx_GOTREF(__pyx_t_3);
19110  { Py_ssize_t __pyx_temp;
19111  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
19112  __Pyx_INCREF(__pyx_slice__36);
19113  __Pyx_GIVEREF(__pyx_slice__36);
19114  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__36);
19115  }
19116  }
19117  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
19118  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19119 
19120  /* "View.MemoryView":697
19121  *
19122  * nslices = ndim - len(result)
19123  * if nslices: # <<<<<<<<<<<<<<
19124  * result.extend([slice(None)] * nslices)
19125  *
19126  */
19127  }
19128 
19129  /* "View.MemoryView":700
19130  * result.extend([slice(None)] * nslices)
19131  *
19132  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
19133  *
19134  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
19135  */
19136  __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
19137  __Pyx_XDECREF(__pyx_r);
19138  if (!__pyx_v_have_slices) {
19139  } else {
19140  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
19141  __Pyx_GOTREF(__pyx_t_4);
19142  __pyx_t_3 = __pyx_t_4;
19143  __pyx_t_4 = 0;
19144  goto __pyx_L14_bool_binop_done;
19145  }
19146  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
19147  __Pyx_GOTREF(__pyx_t_4);
19148  __pyx_t_3 = __pyx_t_4;
19149  __pyx_t_4 = 0;
19150  __pyx_L14_bool_binop_done:;
19151  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
19152  __Pyx_GOTREF(__pyx_t_4);
19153  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
19154  __Pyx_GOTREF(__pyx_t_11);
19155  __Pyx_GIVEREF(__pyx_t_3);
19156  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
19157  __Pyx_GIVEREF(__pyx_t_4);
19158  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
19159  __pyx_t_3 = 0;
19160  __pyx_t_4 = 0;
19161  __pyx_r = ((PyObject*)__pyx_t_11);
19162  __pyx_t_11 = 0;
19163  goto __pyx_L0;
19164 
19165  /* "View.MemoryView":668
19166  * return isinstance(o, memoryview)
19167  *
19168  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
19169  * """
19170  * Replace all ellipses with full slices and fill incomplete indices with
19171  */
19172 
19173  /* function exit code */
19174  __pyx_L1_error:;
19175  __Pyx_XDECREF(__pyx_t_3);
19176  __Pyx_XDECREF(__pyx_t_4);
19177  __Pyx_XDECREF(__pyx_t_7);
19178  __Pyx_XDECREF(__pyx_t_11);
19179  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
19180  __pyx_r = 0;
19181  __pyx_L0:;
19182  __Pyx_XDECREF(__pyx_v_tup);
19183  __Pyx_XDECREF(__pyx_v_result);
19184  __Pyx_XDECREF(__pyx_v_idx);
19185  __Pyx_XDECREF(__pyx_v_item);
19186  __Pyx_XGIVEREF(__pyx_r);
19187  __Pyx_TraceReturn(__pyx_r, 0);
19188  __Pyx_RefNannyFinishContext();
19189  return __pyx_r;
19190 }
19191 
19192 /* "View.MemoryView":702
19193  * return have_slices or nslices, tuple(result)
19194  *
19195  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
19196  * for suboffset in suboffsets[:ndim]:
19197  * if suboffset >= 0:
19198  */
19199 
19200 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
19201  Py_ssize_t __pyx_v_suboffset;
19202  PyObject *__pyx_r = NULL;
19203  __Pyx_TraceDeclarations
19204  __Pyx_RefNannyDeclarations
19205  Py_ssize_t *__pyx_t_1;
19206  Py_ssize_t *__pyx_t_2;
19207  Py_ssize_t *__pyx_t_3;
19208  int __pyx_t_4;
19209  PyObject *__pyx_t_5 = NULL;
19210  int __pyx_lineno = 0;
19211  const char *__pyx_filename = NULL;
19212  int __pyx_clineno = 0;
19213  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
19214  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
19215 
19216  /* "View.MemoryView":703
19217  *
19218  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
19219  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
19220  * if suboffset >= 0:
19221  * raise ValueError("Indirect dimensions not supported")
19222  */
19223  __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
19224  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
19225  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
19226  __pyx_t_1 = __pyx_t_3;
19227  __pyx_v_suboffset = (__pyx_t_1[0]);
19228 
19229  /* "View.MemoryView":704
19230  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
19231  * for suboffset in suboffsets[:ndim]:
19232  * if suboffset >= 0: # <<<<<<<<<<<<<<
19233  * raise ValueError("Indirect dimensions not supported")
19234  *
19235  */
19236  __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
19237  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
19238  if (unlikely(__pyx_t_4)) {
19239 
19240  /* "View.MemoryView":705
19241  * for suboffset in suboffsets[:ndim]:
19242  * if suboffset >= 0:
19243  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
19244  *
19245  *
19246  */
19247  __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
19248  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
19249  __Pyx_GOTREF(__pyx_t_5);
19250  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
19251  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19252  __PYX_ERR(1, 705, __pyx_L1_error)
19253 
19254  /* "View.MemoryView":704
19255  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
19256  * for suboffset in suboffsets[:ndim]:
19257  * if suboffset >= 0: # <<<<<<<<<<<<<<
19258  * raise ValueError("Indirect dimensions not supported")
19259  *
19260  */
19261  }
19262  }
19263 
19264  /* "View.MemoryView":702
19265  * return have_slices or nslices, tuple(result)
19266  *
19267  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
19268  * for suboffset in suboffsets[:ndim]:
19269  * if suboffset >= 0:
19270  */
19271 
19272  /* function exit code */
19273  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19274  goto __pyx_L0;
19275  __pyx_L1_error:;
19276  __Pyx_XDECREF(__pyx_t_5);
19277  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
19278  __pyx_r = 0;
19279  __pyx_L0:;
19280  __Pyx_XGIVEREF(__pyx_r);
19281  __Pyx_TraceReturn(__pyx_r, 0);
19282  __Pyx_RefNannyFinishContext();
19283  return __pyx_r;
19284 }
19285 
19286 /* "View.MemoryView":712
19287  *
19288  * @cname('__pyx_memview_slice')
19289  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
19290  * cdef int new_ndim = 0, suboffset_dim = -1, dim
19291  * cdef bint negative_step
19292  */
19293 
19294 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
19295  int __pyx_v_new_ndim;
19296  int __pyx_v_suboffset_dim;
19297  int __pyx_v_dim;
19298  __Pyx_memviewslice __pyx_v_src;
19299  __Pyx_memviewslice __pyx_v_dst;
19300  __Pyx_memviewslice *__pyx_v_p_src;
19301  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
19302  __Pyx_memviewslice *__pyx_v_p_dst;
19303  int *__pyx_v_p_suboffset_dim;
19304  Py_ssize_t __pyx_v_start;
19305  Py_ssize_t __pyx_v_stop;
19306  Py_ssize_t __pyx_v_step;
19307  int __pyx_v_have_start;
19308  int __pyx_v_have_stop;
19309  int __pyx_v_have_step;
19310  PyObject *__pyx_v_index = NULL;
19311  struct __pyx_memoryview_obj *__pyx_r = NULL;
19312  __Pyx_TraceDeclarations
19313  __Pyx_RefNannyDeclarations
19314  int __pyx_t_1;
19315  int __pyx_t_2;
19316  PyObject *__pyx_t_3 = NULL;
19317  struct __pyx_memoryview_obj *__pyx_t_4;
19318  char *__pyx_t_5;
19319  int __pyx_t_6;
19320  Py_ssize_t __pyx_t_7;
19321  PyObject *(*__pyx_t_8)(PyObject *);
19322  PyObject *__pyx_t_9 = NULL;
19323  Py_ssize_t __pyx_t_10;
19324  int __pyx_t_11;
19325  Py_ssize_t __pyx_t_12;
19326  int __pyx_lineno = 0;
19327  const char *__pyx_filename = NULL;
19328  int __pyx_clineno = 0;
19329  __Pyx_RefNannySetupContext("memview_slice", 0);
19330  __Pyx_TraceCall("memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
19331 
19332  /* "View.MemoryView":713
19333  * @cname('__pyx_memview_slice')
19334  * cdef memoryview memview_slice(memoryview memview, object indices):
19335  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
19336  * cdef bint negative_step
19337  * cdef __Pyx_memviewslice src, dst
19338  */
19339  __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
19340  __pyx_v_new_ndim = 0;
19341  __pyx_v_suboffset_dim = -1;
19342 
19343  /* "View.MemoryView":720
19344  *
19345  *
19346  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
19347  *
19348  * cdef _memoryviewslice memviewsliceobj
19349  */
19350  __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
19351  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
19352 
19353  /* "View.MemoryView":724
19354  * cdef _memoryviewslice memviewsliceobj
19355  *
19356  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
19357  *
19358  * if isinstance(memview, _memoryviewslice):
19359  */
19360  __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
19361  #ifndef CYTHON_WITHOUT_ASSERTIONS
19362  if (unlikely(__pyx_assertions_enabled())) {
19363  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
19364  PyErr_SetNone(PyExc_AssertionError);
19365  __PYX_ERR(1, 724, __pyx_L1_error)
19366  }
19367  }
19368  #endif
19369 
19370  /* "View.MemoryView":726
19371  * assert memview.view.ndim > 0
19372  *
19373  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19374  * memviewsliceobj = memview
19375  * p_src = &memviewsliceobj.from_slice
19376  */
19377  __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
19378  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19379  __pyx_t_2 = (__pyx_t_1 != 0);
19380  if (__pyx_t_2) {
19381 
19382  /* "View.MemoryView":727
19383  *
19384  * if isinstance(memview, _memoryviewslice):
19385  * memviewsliceobj = memview # <<<<<<<<<<<<<<
19386  * p_src = &memviewsliceobj.from_slice
19387  * else:
19388  */
19389  __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
19390  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
19391  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
19392  __Pyx_INCREF(__pyx_t_3);
19393  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
19394  __pyx_t_3 = 0;
19395 
19396  /* "View.MemoryView":728
19397  * if isinstance(memview, _memoryviewslice):
19398  * memviewsliceobj = memview
19399  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
19400  * else:
19401  * slice_copy(memview, &src)
19402  */
19403  __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
19404  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
19405 
19406  /* "View.MemoryView":726
19407  * assert memview.view.ndim > 0
19408  *
19409  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19410  * memviewsliceobj = memview
19411  * p_src = &memviewsliceobj.from_slice
19412  */
19413  goto __pyx_L3;
19414  }
19415 
19416  /* "View.MemoryView":730
19417  * p_src = &memviewsliceobj.from_slice
19418  * else:
19419  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
19420  * p_src = &src
19421  *
19422  */
19423  __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
19424  /*else*/ {
19425  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
19426 
19427  /* "View.MemoryView":731
19428  * else:
19429  * slice_copy(memview, &src)
19430  * p_src = &src # <<<<<<<<<<<<<<
19431  *
19432  *
19433  */
19434  __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
19435  __pyx_v_p_src = (&__pyx_v_src);
19436  }
19437  __pyx_L3:;
19438 
19439  /* "View.MemoryView":737
19440  *
19441  *
19442  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
19443  * dst.data = p_src.data
19444  *
19445  */
19446  __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
19447  __pyx_t_4 = __pyx_v_p_src->memview;
19448  __pyx_v_dst.memview = __pyx_t_4;
19449 
19450  /* "View.MemoryView":738
19451  *
19452  * dst.memview = p_src.memview
19453  * dst.data = p_src.data # <<<<<<<<<<<<<<
19454  *
19455  *
19456  */
19457  __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
19458  __pyx_t_5 = __pyx_v_p_src->data;
19459  __pyx_v_dst.data = __pyx_t_5;
19460 
19461  /* "View.MemoryView":743
19462  *
19463  *
19464  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
19465  * cdef int *p_suboffset_dim = &suboffset_dim
19466  * cdef Py_ssize_t start, stop, step
19467  */
19468  __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
19469  __pyx_v_p_dst = (&__pyx_v_dst);
19470 
19471  /* "View.MemoryView":744
19472  *
19473  * cdef __Pyx_memviewslice *p_dst = &dst
19474  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
19475  * cdef Py_ssize_t start, stop, step
19476  * cdef bint have_start, have_stop, have_step
19477  */
19478  __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
19479  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
19480 
19481  /* "View.MemoryView":748
19482  * cdef bint have_start, have_stop, have_step
19483  *
19484  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
19485  * if PyIndex_Check(index):
19486  * slice_memviewslice(
19487  */
19488  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
19489  __pyx_t_6 = 0;
19490  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
19491  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
19492  __pyx_t_8 = NULL;
19493  } else {
19494  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
19495  __Pyx_GOTREF(__pyx_t_3);
19496  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
19497  }
19498  for (;;) {
19499  if (likely(!__pyx_t_8)) {
19500  if (likely(PyList_CheckExact(__pyx_t_3))) {
19501  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
19502  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19503  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
19504  #else
19505  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
19506  __Pyx_GOTREF(__pyx_t_9);
19507  #endif
19508  } else {
19509  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
19510  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19511  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
19512  #else
19513  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
19514  __Pyx_GOTREF(__pyx_t_9);
19515  #endif
19516  }
19517  } else {
19518  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
19519  if (unlikely(!__pyx_t_9)) {
19520  PyObject* exc_type = PyErr_Occurred();
19521  if (exc_type) {
19522  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
19523  else __PYX_ERR(1, 748, __pyx_L1_error)
19524  }
19525  break;
19526  }
19527  __Pyx_GOTREF(__pyx_t_9);
19528  }
19529  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
19530  __pyx_t_9 = 0;
19531  __pyx_v_dim = __pyx_t_6;
19532  __pyx_t_6 = (__pyx_t_6 + 1);
19533 
19534  /* "View.MemoryView":749
19535  *
19536  * for dim, index in enumerate(indices):
19537  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
19538  * slice_memviewslice(
19539  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19540  */
19541  __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
19542  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
19543  if (__pyx_t_2) {
19544 
19545  /* "View.MemoryView":753
19546  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19547  * dim, new_ndim, p_suboffset_dim,
19548  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
19549  * 0, 0, 0, # have_{start,stop,step}
19550  * False)
19551  */
19552  __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
19553  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
19554 
19555  /* "View.MemoryView":750
19556  * for dim, index in enumerate(indices):
19557  * if PyIndex_Check(index):
19558  * slice_memviewslice( # <<<<<<<<<<<<<<
19559  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19560  * dim, new_ndim, p_suboffset_dim,
19561  */
19562  __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
19563  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
19564 
19565  /* "View.MemoryView":749
19566  *
19567  * for dim, index in enumerate(indices):
19568  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
19569  * slice_memviewslice(
19570  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19571  */
19572  goto __pyx_L6;
19573  }
19574 
19575  /* "View.MemoryView":756
19576  * 0, 0, 0, # have_{start,stop,step}
19577  * False)
19578  * elif index is None: # <<<<<<<<<<<<<<
19579  * p_dst.shape[new_ndim] = 1
19580  * p_dst.strides[new_ndim] = 0
19581  */
19582  __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
19583  __pyx_t_2 = (__pyx_v_index == Py_None);
19584  __pyx_t_1 = (__pyx_t_2 != 0);
19585  if (__pyx_t_1) {
19586 
19587  /* "View.MemoryView":757
19588  * False)
19589  * elif index is None:
19590  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
19591  * p_dst.strides[new_ndim] = 0
19592  * p_dst.suboffsets[new_ndim] = -1
19593  */
19594  __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
19595  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
19596 
19597  /* "View.MemoryView":758
19598  * elif index is None:
19599  * p_dst.shape[new_ndim] = 1
19600  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
19601  * p_dst.suboffsets[new_ndim] = -1
19602  * new_ndim += 1
19603  */
19604  __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
19605  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
19606 
19607  /* "View.MemoryView":759
19608  * p_dst.shape[new_ndim] = 1
19609  * p_dst.strides[new_ndim] = 0
19610  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
19611  * new_ndim += 1
19612  * else:
19613  */
19614  __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
19615  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
19616 
19617  /* "View.MemoryView":760
19618  * p_dst.strides[new_ndim] = 0
19619  * p_dst.suboffsets[new_ndim] = -1
19620  * new_ndim += 1 # <<<<<<<<<<<<<<
19621  * else:
19622  * start = index.start or 0
19623  */
19624  __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
19625  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
19626 
19627  /* "View.MemoryView":756
19628  * 0, 0, 0, # have_{start,stop,step}
19629  * False)
19630  * elif index is None: # <<<<<<<<<<<<<<
19631  * p_dst.shape[new_ndim] = 1
19632  * p_dst.strides[new_ndim] = 0
19633  */
19634  goto __pyx_L6;
19635  }
19636 
19637  /* "View.MemoryView":762
19638  * new_ndim += 1
19639  * else:
19640  * start = index.start or 0 # <<<<<<<<<<<<<<
19641  * stop = index.stop or 0
19642  * step = index.step or 0
19643  */
19644  __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
19645  /*else*/ {
19646  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
19647  __Pyx_GOTREF(__pyx_t_9);
19648  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
19649  if (!__pyx_t_1) {
19650  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19651  } else {
19652  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
19653  __pyx_t_10 = __pyx_t_12;
19654  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19655  goto __pyx_L7_bool_binop_done;
19656  }
19657  __pyx_t_10 = 0;
19658  __pyx_L7_bool_binop_done:;
19659  __pyx_v_start = __pyx_t_10;
19660 
19661  /* "View.MemoryView":763
19662  * else:
19663  * start = index.start or 0
19664  * stop = index.stop or 0 # <<<<<<<<<<<<<<
19665  * step = index.step or 0
19666  *
19667  */
19668  __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
19669  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
19670  __Pyx_GOTREF(__pyx_t_9);
19671  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
19672  if (!__pyx_t_1) {
19673  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19674  } else {
19675  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
19676  __pyx_t_10 = __pyx_t_12;
19677  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19678  goto __pyx_L9_bool_binop_done;
19679  }
19680  __pyx_t_10 = 0;
19681  __pyx_L9_bool_binop_done:;
19682  __pyx_v_stop = __pyx_t_10;
19683 
19684  /* "View.MemoryView":764
19685  * start = index.start or 0
19686  * stop = index.stop or 0
19687  * step = index.step or 0 # <<<<<<<<<<<<<<
19688  *
19689  * have_start = index.start is not None
19690  */
19691  __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
19692  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
19693  __Pyx_GOTREF(__pyx_t_9);
19694  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
19695  if (!__pyx_t_1) {
19696  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19697  } else {
19698  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
19699  __pyx_t_10 = __pyx_t_12;
19700  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19701  goto __pyx_L11_bool_binop_done;
19702  }
19703  __pyx_t_10 = 0;
19704  __pyx_L11_bool_binop_done:;
19705  __pyx_v_step = __pyx_t_10;
19706 
19707  /* "View.MemoryView":766
19708  * step = index.step or 0
19709  *
19710  * have_start = index.start is not None # <<<<<<<<<<<<<<
19711  * have_stop = index.stop is not None
19712  * have_step = index.step is not None
19713  */
19714  __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
19715  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
19716  __Pyx_GOTREF(__pyx_t_9);
19717  __pyx_t_1 = (__pyx_t_9 != Py_None);
19718  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19719  __pyx_v_have_start = __pyx_t_1;
19720 
19721  /* "View.MemoryView":767
19722  *
19723  * have_start = index.start is not None
19724  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
19725  * have_step = index.step is not None
19726  *
19727  */
19728  __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
19729  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
19730  __Pyx_GOTREF(__pyx_t_9);
19731  __pyx_t_1 = (__pyx_t_9 != Py_None);
19732  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19733  __pyx_v_have_stop = __pyx_t_1;
19734 
19735  /* "View.MemoryView":768
19736  * have_start = index.start is not None
19737  * have_stop = index.stop is not None
19738  * have_step = index.step is not None # <<<<<<<<<<<<<<
19739  *
19740  * slice_memviewslice(
19741  */
19742  __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
19743  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
19744  __Pyx_GOTREF(__pyx_t_9);
19745  __pyx_t_1 = (__pyx_t_9 != Py_None);
19746  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19747  __pyx_v_have_step = __pyx_t_1;
19748 
19749  /* "View.MemoryView":770
19750  * have_step = index.step is not None
19751  *
19752  * slice_memviewslice( # <<<<<<<<<<<<<<
19753  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19754  * dim, new_ndim, p_suboffset_dim,
19755  */
19756  __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
19757  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
19758 
19759  /* "View.MemoryView":776
19760  * have_start, have_stop, have_step,
19761  * True)
19762  * new_ndim += 1 # <<<<<<<<<<<<<<
19763  *
19764  * if isinstance(memview, _memoryviewslice):
19765  */
19766  __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
19767  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
19768  }
19769  __pyx_L6:;
19770 
19771  /* "View.MemoryView":748
19772  * cdef bint have_start, have_stop, have_step
19773  *
19774  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
19775  * if PyIndex_Check(index):
19776  * slice_memviewslice(
19777  */
19778  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
19779  }
19780  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19781 
19782  /* "View.MemoryView":778
19783  * new_ndim += 1
19784  *
19785  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19786  * return memoryview_fromslice(dst, new_ndim,
19787  * memviewsliceobj.to_object_func,
19788  */
19789  __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
19790  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19791  __pyx_t_2 = (__pyx_t_1 != 0);
19792  if (__pyx_t_2) {
19793 
19794  /* "View.MemoryView":779
19795  *
19796  * if isinstance(memview, _memoryviewslice):
19797  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
19798  * memviewsliceobj.to_object_func,
19799  * memviewsliceobj.to_dtype_func,
19800  */
19801  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
19802  __Pyx_XDECREF(((PyObject *)__pyx_r));
19803 
19804  /* "View.MemoryView":780
19805  * if isinstance(memview, _memoryviewslice):
19806  * return memoryview_fromslice(dst, new_ndim,
19807  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
19808  * memviewsliceobj.to_dtype_func,
19809  * memview.dtype_is_object)
19810  */
19811  __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
19812  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
19813 
19814  /* "View.MemoryView":781
19815  * return memoryview_fromslice(dst, new_ndim,
19816  * memviewsliceobj.to_object_func,
19817  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
19818  * memview.dtype_is_object)
19819  * else:
19820  */
19821  __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
19822  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
19823 
19824  /* "View.MemoryView":779
19825  *
19826  * if isinstance(memview, _memoryviewslice):
19827  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
19828  * memviewsliceobj.to_object_func,
19829  * memviewsliceobj.to_dtype_func,
19830  */
19831  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
19832  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
19833  __Pyx_GOTREF(__pyx_t_3);
19834  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
19835  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
19836  __pyx_t_3 = 0;
19837  goto __pyx_L0;
19838 
19839  /* "View.MemoryView":778
19840  * new_ndim += 1
19841  *
19842  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19843  * return memoryview_fromslice(dst, new_ndim,
19844  * memviewsliceobj.to_object_func,
19845  */
19846  }
19847 
19848  /* "View.MemoryView":784
19849  * memview.dtype_is_object)
19850  * else:
19851  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
19852  * memview.dtype_is_object)
19853  *
19854  */
19855  __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
19856  /*else*/ {
19857  __Pyx_XDECREF(((PyObject *)__pyx_r));
19858 
19859  /* "View.MemoryView":785
19860  * else:
19861  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
19862  * memview.dtype_is_object) # <<<<<<<<<<<<<<
19863  *
19864  *
19865  */
19866  __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
19867  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
19868  __Pyx_GOTREF(__pyx_t_3);
19869 
19870  /* "View.MemoryView":784
19871  * memview.dtype_is_object)
19872  * else:
19873  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
19874  * memview.dtype_is_object)
19875  *
19876  */
19877  __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
19878  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
19879  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
19880  __pyx_t_3 = 0;
19881  goto __pyx_L0;
19882  }
19883 
19884  /* "View.MemoryView":712
19885  *
19886  * @cname('__pyx_memview_slice')
19887  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
19888  * cdef int new_ndim = 0, suboffset_dim = -1, dim
19889  * cdef bint negative_step
19890  */
19891 
19892  /* function exit code */
19893  __pyx_L1_error:;
19894  __Pyx_XDECREF(__pyx_t_3);
19895  __Pyx_XDECREF(__pyx_t_9);
19896  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19897  __pyx_r = 0;
19898  __pyx_L0:;
19899  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
19900  __Pyx_XDECREF(__pyx_v_index);
19901  __Pyx_XGIVEREF((PyObject *)__pyx_r);
19902  __Pyx_TraceReturn(__pyx_r, 0);
19903  __Pyx_RefNannyFinishContext();
19904  return __pyx_r;
19905 }
19906 
19907 /* "View.MemoryView":809
19908  *
19909  * @cname('__pyx_memoryview_slice_memviewslice')
19910  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
19911  * __Pyx_memviewslice *dst,
19912  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
19913  */
19914 
19915 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
19916  Py_ssize_t __pyx_v_new_shape;
19917  int __pyx_v_negative_step;
19918  int __pyx_r;
19919  __Pyx_TraceDeclarations
19920  int __pyx_t_1;
19921  int __pyx_t_2;
19922  int __pyx_t_3;
19923  int __pyx_lineno = 0;
19924  const char *__pyx_filename = NULL;
19925  int __pyx_clineno = 0;
19926  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
19927 
19928  /* "View.MemoryView":829
19929  * cdef bint negative_step
19930  *
19931  * if not is_slice: # <<<<<<<<<<<<<<
19932  *
19933  * if start < 0:
19934  */
19935  __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
19936  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
19937  if (__pyx_t_1) {
19938 
19939  /* "View.MemoryView":831
19940  * if not is_slice:
19941  *
19942  * if start < 0: # <<<<<<<<<<<<<<
19943  * start += shape
19944  * if not 0 <= start < shape:
19945  */
19946  __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
19947  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
19948  if (__pyx_t_1) {
19949 
19950  /* "View.MemoryView":832
19951  *
19952  * if start < 0:
19953  * start += shape # <<<<<<<<<<<<<<
19954  * if not 0 <= start < shape:
19955  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
19956  */
19957  __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
19958  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
19959 
19960  /* "View.MemoryView":831
19961  * if not is_slice:
19962  *
19963  * if start < 0: # <<<<<<<<<<<<<<
19964  * start += shape
19965  * if not 0 <= start < shape:
19966  */
19967  }
19968 
19969  /* "View.MemoryView":833
19970  * if start < 0:
19971  * start += shape
19972  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
19973  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
19974  * else:
19975  */
19976  __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
19977  __pyx_t_1 = (0 <= __pyx_v_start);
19978  if (__pyx_t_1) {
19979  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
19980  }
19981  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
19982  if (__pyx_t_2) {
19983 
19984  /* "View.MemoryView":834
19985  * start += shape
19986  * if not 0 <= start < shape:
19987  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
19988  * else:
19989  *
19990  */
19991  __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
19992  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
19993 
19994  /* "View.MemoryView":833
19995  * if start < 0:
19996  * start += shape
19997  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
19998  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
19999  * else:
20000  */
20001  }
20002 
20003  /* "View.MemoryView":829
20004  * cdef bint negative_step
20005  *
20006  * if not is_slice: # <<<<<<<<<<<<<<
20007  *
20008  * if start < 0:
20009  */
20010  goto __pyx_L3;
20011  }
20012 
20013  /* "View.MemoryView":837
20014  * else:
20015  *
20016  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
20017  *
20018  * if have_step and step == 0:
20019  */
20020  __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
20021  /*else*/ {
20022  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
20023  if (__pyx_t_1) {
20024  } else {
20025  __pyx_t_2 = __pyx_t_1;
20026  goto __pyx_L6_bool_binop_done;
20027  }
20028  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
20029  __pyx_t_2 = __pyx_t_1;
20030  __pyx_L6_bool_binop_done:;
20031  __pyx_v_negative_step = __pyx_t_2;
20032 
20033  /* "View.MemoryView":839
20034  * negative_step = have_step != 0 and step < 0
20035  *
20036  * if have_step and step == 0: # <<<<<<<<<<<<<<
20037  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
20038  *
20039  */
20040  __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
20041  __pyx_t_1 = (__pyx_v_have_step != 0);
20042  if (__pyx_t_1) {
20043  } else {
20044  __pyx_t_2 = __pyx_t_1;
20045  goto __pyx_L9_bool_binop_done;
20046  }
20047  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
20048  __pyx_t_2 = __pyx_t_1;
20049  __pyx_L9_bool_binop_done:;
20050  if (__pyx_t_2) {
20051 
20052  /* "View.MemoryView":840
20053  *
20054  * if have_step and step == 0:
20055  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
20056  *
20057  *
20058  */
20059  __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
20060  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
20061 
20062  /* "View.MemoryView":839
20063  * negative_step = have_step != 0 and step < 0
20064  *
20065  * if have_step and step == 0: # <<<<<<<<<<<<<<
20066  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
20067  *
20068  */
20069  }
20070 
20071  /* "View.MemoryView":843
20072  *
20073  *
20074  * if have_start: # <<<<<<<<<<<<<<
20075  * if start < 0:
20076  * start += shape
20077  */
20078  __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
20079  __pyx_t_2 = (__pyx_v_have_start != 0);
20080  if (__pyx_t_2) {
20081 
20082  /* "View.MemoryView":844
20083  *
20084  * if have_start:
20085  * if start < 0: # <<<<<<<<<<<<<<
20086  * start += shape
20087  * if start < 0:
20088  */
20089  __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
20090  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
20091  if (__pyx_t_2) {
20092 
20093  /* "View.MemoryView":845
20094  * if have_start:
20095  * if start < 0:
20096  * start += shape # <<<<<<<<<<<<<<
20097  * if start < 0:
20098  * start = 0
20099  */
20100  __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
20101  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
20102 
20103  /* "View.MemoryView":846
20104  * if start < 0:
20105  * start += shape
20106  * if start < 0: # <<<<<<<<<<<<<<
20107  * start = 0
20108  * elif start >= shape:
20109  */
20110  __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
20111  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
20112  if (__pyx_t_2) {
20113 
20114  /* "View.MemoryView":847
20115  * start += shape
20116  * if start < 0:
20117  * start = 0 # <<<<<<<<<<<<<<
20118  * elif start >= shape:
20119  * if negative_step:
20120  */
20121  __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
20122  __pyx_v_start = 0;
20123 
20124  /* "View.MemoryView":846
20125  * if start < 0:
20126  * start += shape
20127  * if start < 0: # <<<<<<<<<<<<<<
20128  * start = 0
20129  * elif start >= shape:
20130  */
20131  }
20132 
20133  /* "View.MemoryView":844
20134  *
20135  * if have_start:
20136  * if start < 0: # <<<<<<<<<<<<<<
20137  * start += shape
20138  * if start < 0:
20139  */
20140  goto __pyx_L12;
20141  }
20142 
20143  /* "View.MemoryView":848
20144  * if start < 0:
20145  * start = 0
20146  * elif start >= shape: # <<<<<<<<<<<<<<
20147  * if negative_step:
20148  * start = shape - 1
20149  */
20150  __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
20151  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
20152  if (__pyx_t_2) {
20153 
20154  /* "View.MemoryView":849
20155  * start = 0
20156  * elif start >= shape:
20157  * if negative_step: # <<<<<<<<<<<<<<
20158  * start = shape - 1
20159  * else:
20160  */
20161  __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
20162  __pyx_t_2 = (__pyx_v_negative_step != 0);
20163  if (__pyx_t_2) {
20164 
20165  /* "View.MemoryView":850
20166  * elif start >= shape:
20167  * if negative_step:
20168  * start = shape - 1 # <<<<<<<<<<<<<<
20169  * else:
20170  * start = shape
20171  */
20172  __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
20173  __pyx_v_start = (__pyx_v_shape - 1);
20174 
20175  /* "View.MemoryView":849
20176  * start = 0
20177  * elif start >= shape:
20178  * if negative_step: # <<<<<<<<<<<<<<
20179  * start = shape - 1
20180  * else:
20181  */
20182  goto __pyx_L14;
20183  }
20184 
20185  /* "View.MemoryView":852
20186  * start = shape - 1
20187  * else:
20188  * start = shape # <<<<<<<<<<<<<<
20189  * else:
20190  * if negative_step:
20191  */
20192  __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
20193  /*else*/ {
20194  __pyx_v_start = __pyx_v_shape;
20195  }
20196  __pyx_L14:;
20197 
20198  /* "View.MemoryView":848
20199  * if start < 0:
20200  * start = 0
20201  * elif start >= shape: # <<<<<<<<<<<<<<
20202  * if negative_step:
20203  * start = shape - 1
20204  */
20205  }
20206  __pyx_L12:;
20207 
20208  /* "View.MemoryView":843
20209  *
20210  *
20211  * if have_start: # <<<<<<<<<<<<<<
20212  * if start < 0:
20213  * start += shape
20214  */
20215  goto __pyx_L11;
20216  }
20217 
20218  /* "View.MemoryView":854
20219  * start = shape
20220  * else:
20221  * if negative_step: # <<<<<<<<<<<<<<
20222  * start = shape - 1
20223  * else:
20224  */
20225  __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
20226  /*else*/ {
20227  __pyx_t_2 = (__pyx_v_negative_step != 0);
20228  if (__pyx_t_2) {
20229 
20230  /* "View.MemoryView":855
20231  * else:
20232  * if negative_step:
20233  * start = shape - 1 # <<<<<<<<<<<<<<
20234  * else:
20235  * start = 0
20236  */
20237  __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
20238  __pyx_v_start = (__pyx_v_shape - 1);
20239 
20240  /* "View.MemoryView":854
20241  * start = shape
20242  * else:
20243  * if negative_step: # <<<<<<<<<<<<<<
20244  * start = shape - 1
20245  * else:
20246  */
20247  goto __pyx_L15;
20248  }
20249 
20250  /* "View.MemoryView":857
20251  * start = shape - 1
20252  * else:
20253  * start = 0 # <<<<<<<<<<<<<<
20254  *
20255  * if have_stop:
20256  */
20257  __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
20258  /*else*/ {
20259  __pyx_v_start = 0;
20260  }
20261  __pyx_L15:;
20262  }
20263  __pyx_L11:;
20264 
20265  /* "View.MemoryView":859
20266  * start = 0
20267  *
20268  * if have_stop: # <<<<<<<<<<<<<<
20269  * if stop < 0:
20270  * stop += shape
20271  */
20272  __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
20273  __pyx_t_2 = (__pyx_v_have_stop != 0);
20274  if (__pyx_t_2) {
20275 
20276  /* "View.MemoryView":860
20277  *
20278  * if have_stop:
20279  * if stop < 0: # <<<<<<<<<<<<<<
20280  * stop += shape
20281  * if stop < 0:
20282  */
20283  __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
20284  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20285  if (__pyx_t_2) {
20286 
20287  /* "View.MemoryView":861
20288  * if have_stop:
20289  * if stop < 0:
20290  * stop += shape # <<<<<<<<<<<<<<
20291  * if stop < 0:
20292  * stop = 0
20293  */
20294  __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
20295  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
20296 
20297  /* "View.MemoryView":862
20298  * if stop < 0:
20299  * stop += shape
20300  * if stop < 0: # <<<<<<<<<<<<<<
20301  * stop = 0
20302  * elif stop > shape:
20303  */
20304  __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
20305  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20306  if (__pyx_t_2) {
20307 
20308  /* "View.MemoryView":863
20309  * stop += shape
20310  * if stop < 0:
20311  * stop = 0 # <<<<<<<<<<<<<<
20312  * elif stop > shape:
20313  * stop = shape
20314  */
20315  __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
20316  __pyx_v_stop = 0;
20317 
20318  /* "View.MemoryView":862
20319  * if stop < 0:
20320  * stop += shape
20321  * if stop < 0: # <<<<<<<<<<<<<<
20322  * stop = 0
20323  * elif stop > shape:
20324  */
20325  }
20326 
20327  /* "View.MemoryView":860
20328  *
20329  * if have_stop:
20330  * if stop < 0: # <<<<<<<<<<<<<<
20331  * stop += shape
20332  * if stop < 0:
20333  */
20334  goto __pyx_L17;
20335  }
20336 
20337  /* "View.MemoryView":864
20338  * if stop < 0:
20339  * stop = 0
20340  * elif stop > shape: # <<<<<<<<<<<<<<
20341  * stop = shape
20342  * else:
20343  */
20344  __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
20345  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
20346  if (__pyx_t_2) {
20347 
20348  /* "View.MemoryView":865
20349  * stop = 0
20350  * elif stop > shape:
20351  * stop = shape # <<<<<<<<<<<<<<
20352  * else:
20353  * if negative_step:
20354  */
20355  __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
20356  __pyx_v_stop = __pyx_v_shape;
20357 
20358  /* "View.MemoryView":864
20359  * if stop < 0:
20360  * stop = 0
20361  * elif stop > shape: # <<<<<<<<<<<<<<
20362  * stop = shape
20363  * else:
20364  */
20365  }
20366  __pyx_L17:;
20367 
20368  /* "View.MemoryView":859
20369  * start = 0
20370  *
20371  * if have_stop: # <<<<<<<<<<<<<<
20372  * if stop < 0:
20373  * stop += shape
20374  */
20375  goto __pyx_L16;
20376  }
20377 
20378  /* "View.MemoryView":867
20379  * stop = shape
20380  * else:
20381  * if negative_step: # <<<<<<<<<<<<<<
20382  * stop = -1
20383  * else:
20384  */
20385  __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
20386  /*else*/ {
20387  __pyx_t_2 = (__pyx_v_negative_step != 0);
20388  if (__pyx_t_2) {
20389 
20390  /* "View.MemoryView":868
20391  * else:
20392  * if negative_step:
20393  * stop = -1 # <<<<<<<<<<<<<<
20394  * else:
20395  * stop = shape
20396  */
20397  __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
20398  __pyx_v_stop = -1L;
20399 
20400  /* "View.MemoryView":867
20401  * stop = shape
20402  * else:
20403  * if negative_step: # <<<<<<<<<<<<<<
20404  * stop = -1
20405  * else:
20406  */
20407  goto __pyx_L19;
20408  }
20409 
20410  /* "View.MemoryView":870
20411  * stop = -1
20412  * else:
20413  * stop = shape # <<<<<<<<<<<<<<
20414  *
20415  * if not have_step:
20416  */
20417  __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
20418  /*else*/ {
20419  __pyx_v_stop = __pyx_v_shape;
20420  }
20421  __pyx_L19:;
20422  }
20423  __pyx_L16:;
20424 
20425  /* "View.MemoryView":872
20426  * stop = shape
20427  *
20428  * if not have_step: # <<<<<<<<<<<<<<
20429  * step = 1
20430  *
20431  */
20432  __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
20433  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
20434  if (__pyx_t_2) {
20435 
20436  /* "View.MemoryView":873
20437  *
20438  * if not have_step:
20439  * step = 1 # <<<<<<<<<<<<<<
20440  *
20441  *
20442  */
20443  __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
20444  __pyx_v_step = 1;
20445 
20446  /* "View.MemoryView":872
20447  * stop = shape
20448  *
20449  * if not have_step: # <<<<<<<<<<<<<<
20450  * step = 1
20451  *
20452  */
20453  }
20454 
20455  /* "View.MemoryView":877
20456  *
20457  * with cython.cdivision(True):
20458  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
20459  *
20460  * if (stop - start) - step * new_shape:
20461  */
20462  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
20463 
20464  /* "View.MemoryView":879
20465  * new_shape = (stop - start) // step
20466  *
20467  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
20468  * new_shape += 1
20469  *
20470  */
20471  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
20472  if (__pyx_t_2) {
20473 
20474  /* "View.MemoryView":880
20475  *
20476  * if (stop - start) - step * new_shape:
20477  * new_shape += 1 # <<<<<<<<<<<<<<
20478  *
20479  * if new_shape < 0:
20480  */
20481  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
20482 
20483  /* "View.MemoryView":879
20484  * new_shape = (stop - start) // step
20485  *
20486  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
20487  * new_shape += 1
20488  *
20489  */
20490  }
20491 
20492  /* "View.MemoryView":882
20493  * new_shape += 1
20494  *
20495  * if new_shape < 0: # <<<<<<<<<<<<<<
20496  * new_shape = 0
20497  *
20498  */
20499  __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
20500  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
20501  if (__pyx_t_2) {
20502 
20503  /* "View.MemoryView":883
20504  *
20505  * if new_shape < 0:
20506  * new_shape = 0 # <<<<<<<<<<<<<<
20507  *
20508  *
20509  */
20510  __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
20511  __pyx_v_new_shape = 0;
20512 
20513  /* "View.MemoryView":882
20514  * new_shape += 1
20515  *
20516  * if new_shape < 0: # <<<<<<<<<<<<<<
20517  * new_shape = 0
20518  *
20519  */
20520  }
20521 
20522  /* "View.MemoryView":886
20523  *
20524  *
20525  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
20526  * dst.shape[new_ndim] = new_shape
20527  * dst.suboffsets[new_ndim] = suboffset
20528  */
20529  __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
20530  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
20531 
20532  /* "View.MemoryView":887
20533  *
20534  * dst.strides[new_ndim] = stride * step
20535  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
20536  * dst.suboffsets[new_ndim] = suboffset
20537  *
20538  */
20539  __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
20540  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
20541 
20542  /* "View.MemoryView":888
20543  * dst.strides[new_ndim] = stride * step
20544  * dst.shape[new_ndim] = new_shape
20545  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
20546  *
20547  *
20548  */
20549  __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
20550  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
20551  }
20552  __pyx_L3:;
20553 
20554  /* "View.MemoryView":891
20555  *
20556  *
20557  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
20558  * dst.data += start * stride
20559  * else:
20560  */
20561  __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
20562  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
20563  if (__pyx_t_2) {
20564 
20565  /* "View.MemoryView":892
20566  *
20567  * if suboffset_dim[0] < 0:
20568  * dst.data += start * stride # <<<<<<<<<<<<<<
20569  * else:
20570  * dst.suboffsets[suboffset_dim[0]] += start * stride
20571  */
20572  __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
20573  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
20574 
20575  /* "View.MemoryView":891
20576  *
20577  *
20578  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
20579  * dst.data += start * stride
20580  * else:
20581  */
20582  goto __pyx_L23;
20583  }
20584 
20585  /* "View.MemoryView":894
20586  * dst.data += start * stride
20587  * else:
20588  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
20589  *
20590  * if suboffset >= 0:
20591  */
20592  __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
20593  /*else*/ {
20594  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
20595  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
20596  }
20597  __pyx_L23:;
20598 
20599  /* "View.MemoryView":896
20600  * dst.suboffsets[suboffset_dim[0]] += start * stride
20601  *
20602  * if suboffset >= 0: # <<<<<<<<<<<<<<
20603  * if not is_slice:
20604  * if new_ndim == 0:
20605  */
20606  __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
20607  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
20608  if (__pyx_t_2) {
20609 
20610  /* "View.MemoryView":897
20611  *
20612  * if suboffset >= 0:
20613  * if not is_slice: # <<<<<<<<<<<<<<
20614  * if new_ndim == 0:
20615  * dst.data = (<char **> dst.data)[0] + suboffset
20616  */
20617  __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
20618  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
20619  if (__pyx_t_2) {
20620 
20621  /* "View.MemoryView":898
20622  * if suboffset >= 0:
20623  * if not is_slice:
20624  * if new_ndim == 0: # <<<<<<<<<<<<<<
20625  * dst.data = (<char **> dst.data)[0] + suboffset
20626  * else:
20627  */
20628  __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
20629  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
20630  if (__pyx_t_2) {
20631 
20632  /* "View.MemoryView":899
20633  * if not is_slice:
20634  * if new_ndim == 0:
20635  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
20636  * else:
20637  * _err_dim(IndexError, "All dimensions preceding dimension %d "
20638  */
20639  __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
20640  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
20641 
20642  /* "View.MemoryView":898
20643  * if suboffset >= 0:
20644  * if not is_slice:
20645  * if new_ndim == 0: # <<<<<<<<<<<<<<
20646  * dst.data = (<char **> dst.data)[0] + suboffset
20647  * else:
20648  */
20649  goto __pyx_L26;
20650  }
20651 
20652  /* "View.MemoryView":901
20653  * dst.data = (<char **> dst.data)[0] + suboffset
20654  * else:
20655  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
20656  * "must be indexed and not sliced", dim)
20657  * else:
20658  */
20659  __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
20660  /*else*/ {
20661 
20662  /* "View.MemoryView":902
20663  * else:
20664  * _err_dim(IndexError, "All dimensions preceding dimension %d "
20665  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
20666  * else:
20667  * suboffset_dim[0] = new_ndim
20668  */
20669  __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
20670  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
20671  }
20672  __pyx_L26:;
20673 
20674  /* "View.MemoryView":897
20675  *
20676  * if suboffset >= 0:
20677  * if not is_slice: # <<<<<<<<<<<<<<
20678  * if new_ndim == 0:
20679  * dst.data = (<char **> dst.data)[0] + suboffset
20680  */
20681  goto __pyx_L25;
20682  }
20683 
20684  /* "View.MemoryView":904
20685  * "must be indexed and not sliced", dim)
20686  * else:
20687  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
20688  *
20689  * return 0
20690  */
20691  __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
20692  /*else*/ {
20693  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
20694  }
20695  __pyx_L25:;
20696 
20697  /* "View.MemoryView":896
20698  * dst.suboffsets[suboffset_dim[0]] += start * stride
20699  *
20700  * if suboffset >= 0: # <<<<<<<<<<<<<<
20701  * if not is_slice:
20702  * if new_ndim == 0:
20703  */
20704  }
20705 
20706  /* "View.MemoryView":906
20707  * suboffset_dim[0] = new_ndim
20708  *
20709  * return 0 # <<<<<<<<<<<<<<
20710  *
20711  *
20712  */
20713  __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
20714  __pyx_r = 0;
20715  goto __pyx_L0;
20716 
20717  /* "View.MemoryView":809
20718  *
20719  * @cname('__pyx_memoryview_slice_memviewslice')
20720  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
20721  * __Pyx_memviewslice *dst,
20722  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
20723  */
20724 
20725  /* function exit code */
20726  __pyx_L1_error:;
20727  {
20728  #ifdef WITH_THREAD
20729  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20730  #endif
20731  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20732  #ifdef WITH_THREAD
20733  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20734  #endif
20735  }
20736  __pyx_r = -1;
20737  __pyx_L0:;
20738  __Pyx_TraceReturn(Py_None, 1);
20739  return __pyx_r;
20740 }
20741 
20742 /* "View.MemoryView":912
20743  *
20744  * @cname('__pyx_pybuffer_index')
20745  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
20746  * Py_ssize_t dim) except NULL:
20747  * cdef Py_ssize_t shape, stride, suboffset = -1
20748  */
20749 
20750 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
20751  Py_ssize_t __pyx_v_shape;
20752  Py_ssize_t __pyx_v_stride;
20753  Py_ssize_t __pyx_v_suboffset;
20754  Py_ssize_t __pyx_v_itemsize;
20755  char *__pyx_v_resultp;
20756  char *__pyx_r;
20757  __Pyx_TraceDeclarations
20758  __Pyx_RefNannyDeclarations
20759  Py_ssize_t __pyx_t_1;
20760  int __pyx_t_2;
20761  PyObject *__pyx_t_3 = NULL;
20762  PyObject *__pyx_t_4 = NULL;
20763  int __pyx_lineno = 0;
20764  const char *__pyx_filename = NULL;
20765  int __pyx_clineno = 0;
20766  __Pyx_RefNannySetupContext("pybuffer_index", 0);
20767  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
20768 
20769  /* "View.MemoryView":914
20770  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
20771  * Py_ssize_t dim) except NULL:
20772  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
20773  * cdef Py_ssize_t itemsize = view.itemsize
20774  * cdef char *resultp
20775  */
20776  __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
20777  __pyx_v_suboffset = -1L;
20778 
20779  /* "View.MemoryView":915
20780  * Py_ssize_t dim) except NULL:
20781  * cdef Py_ssize_t shape, stride, suboffset = -1
20782  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
20783  * cdef char *resultp
20784  *
20785  */
20786  __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
20787  __pyx_t_1 = __pyx_v_view->itemsize;
20788  __pyx_v_itemsize = __pyx_t_1;
20789 
20790  /* "View.MemoryView":918
20791  * cdef char *resultp
20792  *
20793  * if view.ndim == 0: # <<<<<<<<<<<<<<
20794  * shape = view.len / itemsize
20795  * stride = itemsize
20796  */
20797  __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
20798  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
20799  if (__pyx_t_2) {
20800 
20801  /* "View.MemoryView":919
20802  *
20803  * if view.ndim == 0:
20804  * shape = view.len / itemsize # <<<<<<<<<<<<<<
20805  * stride = itemsize
20806  * else:
20807  */
20808  __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
20809  if (unlikely(__pyx_v_itemsize == 0)) {
20810  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
20811  __PYX_ERR(1, 919, __pyx_L1_error)
20812  }
20813  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
20814  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
20815  __PYX_ERR(1, 919, __pyx_L1_error)
20816  }
20817  __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
20818 
20819  /* "View.MemoryView":920
20820  * if view.ndim == 0:
20821  * shape = view.len / itemsize
20822  * stride = itemsize # <<<<<<<<<<<<<<
20823  * else:
20824  * shape = view.shape[dim]
20825  */
20826  __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
20827  __pyx_v_stride = __pyx_v_itemsize;
20828 
20829  /* "View.MemoryView":918
20830  * cdef char *resultp
20831  *
20832  * if view.ndim == 0: # <<<<<<<<<<<<<<
20833  * shape = view.len / itemsize
20834  * stride = itemsize
20835  */
20836  goto __pyx_L3;
20837  }
20838 
20839  /* "View.MemoryView":922
20840  * stride = itemsize
20841  * else:
20842  * shape = view.shape[dim] # <<<<<<<<<<<<<<
20843  * stride = view.strides[dim]
20844  * if view.suboffsets != NULL:
20845  */
20846  __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
20847  /*else*/ {
20848  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
20849 
20850  /* "View.MemoryView":923
20851  * else:
20852  * shape = view.shape[dim]
20853  * stride = view.strides[dim] # <<<<<<<<<<<<<<
20854  * if view.suboffsets != NULL:
20855  * suboffset = view.suboffsets[dim]
20856  */
20857  __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
20858  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
20859 
20860  /* "View.MemoryView":924
20861  * shape = view.shape[dim]
20862  * stride = view.strides[dim]
20863  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
20864  * suboffset = view.suboffsets[dim]
20865  *
20866  */
20867  __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
20868  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
20869  if (__pyx_t_2) {
20870 
20871  /* "View.MemoryView":925
20872  * stride = view.strides[dim]
20873  * if view.suboffsets != NULL:
20874  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
20875  *
20876  * if index < 0:
20877  */
20878  __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
20879  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
20880 
20881  /* "View.MemoryView":924
20882  * shape = view.shape[dim]
20883  * stride = view.strides[dim]
20884  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
20885  * suboffset = view.suboffsets[dim]
20886  *
20887  */
20888  }
20889  }
20890  __pyx_L3:;
20891 
20892  /* "View.MemoryView":927
20893  * suboffset = view.suboffsets[dim]
20894  *
20895  * if index < 0: # <<<<<<<<<<<<<<
20896  * index += view.shape[dim]
20897  * if index < 0:
20898  */
20899  __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
20900  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20901  if (__pyx_t_2) {
20902 
20903  /* "View.MemoryView":928
20904  *
20905  * if index < 0:
20906  * index += view.shape[dim] # <<<<<<<<<<<<<<
20907  * if index < 0:
20908  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20909  */
20910  __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
20911  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
20912 
20913  /* "View.MemoryView":929
20914  * if index < 0:
20915  * index += view.shape[dim]
20916  * if index < 0: # <<<<<<<<<<<<<<
20917  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20918  *
20919  */
20920  __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
20921  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20922  if (unlikely(__pyx_t_2)) {
20923 
20924  /* "View.MemoryView":930
20925  * index += view.shape[dim]
20926  * if index < 0:
20927  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
20928  *
20929  * if index >= shape:
20930  */
20931  __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
20932  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
20933  __Pyx_GOTREF(__pyx_t_3);
20934  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
20935  __Pyx_GOTREF(__pyx_t_4);
20936  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20937  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
20938  __Pyx_GOTREF(__pyx_t_3);
20939  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20940  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20941  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20942  __PYX_ERR(1, 930, __pyx_L1_error)
20943 
20944  /* "View.MemoryView":929
20945  * if index < 0:
20946  * index += view.shape[dim]
20947  * if index < 0: # <<<<<<<<<<<<<<
20948  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20949  *
20950  */
20951  }
20952 
20953  /* "View.MemoryView":927
20954  * suboffset = view.suboffsets[dim]
20955  *
20956  * if index < 0: # <<<<<<<<<<<<<<
20957  * index += view.shape[dim]
20958  * if index < 0:
20959  */
20960  }
20961 
20962  /* "View.MemoryView":932
20963  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20964  *
20965  * if index >= shape: # <<<<<<<<<<<<<<
20966  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20967  *
20968  */
20969  __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
20970  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
20971  if (unlikely(__pyx_t_2)) {
20972 
20973  /* "View.MemoryView":933
20974  *
20975  * if index >= shape:
20976  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
20977  *
20978  * resultp = bufp + index * stride
20979  */
20980  __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
20981  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
20982  __Pyx_GOTREF(__pyx_t_3);
20983  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
20984  __Pyx_GOTREF(__pyx_t_4);
20985  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20986  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
20987  __Pyx_GOTREF(__pyx_t_3);
20988  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20989  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20990  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20991  __PYX_ERR(1, 933, __pyx_L1_error)
20992 
20993  /* "View.MemoryView":932
20994  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20995  *
20996  * if index >= shape: # <<<<<<<<<<<<<<
20997  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20998  *
20999  */
21000  }
21001 
21002  /* "View.MemoryView":935
21003  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
21004  *
21005  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
21006  * if suboffset >= 0:
21007  * resultp = (<char **> resultp)[0] + suboffset
21008  */
21009  __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
21010  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
21011 
21012  /* "View.MemoryView":936
21013  *
21014  * resultp = bufp + index * stride
21015  * if suboffset >= 0: # <<<<<<<<<<<<<<
21016  * resultp = (<char **> resultp)[0] + suboffset
21017  *
21018  */
21019  __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
21020  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
21021  if (__pyx_t_2) {
21022 
21023  /* "View.MemoryView":937
21024  * resultp = bufp + index * stride
21025  * if suboffset >= 0:
21026  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
21027  *
21028  * return resultp
21029  */
21030  __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
21031  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
21032 
21033  /* "View.MemoryView":936
21034  *
21035  * resultp = bufp + index * stride
21036  * if suboffset >= 0: # <<<<<<<<<<<<<<
21037  * resultp = (<char **> resultp)[0] + suboffset
21038  *
21039  */
21040  }
21041 
21042  /* "View.MemoryView":939
21043  * resultp = (<char **> resultp)[0] + suboffset
21044  *
21045  * return resultp # <<<<<<<<<<<<<<
21046  *
21047  *
21048  */
21049  __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
21050  __pyx_r = __pyx_v_resultp;
21051  goto __pyx_L0;
21052 
21053  /* "View.MemoryView":912
21054  *
21055  * @cname('__pyx_pybuffer_index')
21056  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
21057  * Py_ssize_t dim) except NULL:
21058  * cdef Py_ssize_t shape, stride, suboffset = -1
21059  */
21060 
21061  /* function exit code */
21062  __pyx_L1_error:;
21063  __Pyx_XDECREF(__pyx_t_3);
21064  __Pyx_XDECREF(__pyx_t_4);
21065  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
21066  __pyx_r = NULL;
21067  __pyx_L0:;
21068  __Pyx_TraceReturn(Py_None, 0);
21069  __Pyx_RefNannyFinishContext();
21070  return __pyx_r;
21071 }
21072 
21073 /* "View.MemoryView":945
21074  *
21075  * @cname('__pyx_memslice_transpose')
21076  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
21077  * cdef int ndim = memslice.memview.view.ndim
21078  *
21079  */
21080 
21081 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
21082  int __pyx_v_ndim;
21083  Py_ssize_t *__pyx_v_shape;
21084  Py_ssize_t *__pyx_v_strides;
21085  int __pyx_v_i;
21086  int __pyx_v_j;
21087  int __pyx_r;
21088  __Pyx_TraceDeclarations
21089  int __pyx_t_1;
21090  Py_ssize_t *__pyx_t_2;
21091  long __pyx_t_3;
21092  long __pyx_t_4;
21093  Py_ssize_t __pyx_t_5;
21094  Py_ssize_t __pyx_t_6;
21095  int __pyx_t_7;
21096  int __pyx_t_8;
21097  int __pyx_t_9;
21098  int __pyx_lineno = 0;
21099  const char *__pyx_filename = NULL;
21100  int __pyx_clineno = 0;
21101  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
21102 
21103  /* "View.MemoryView":946
21104  * @cname('__pyx_memslice_transpose')
21105  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
21106  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
21107  *
21108  * cdef Py_ssize_t *shape = memslice.shape
21109  */
21110  __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
21111  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
21112  __pyx_v_ndim = __pyx_t_1;
21113 
21114  /* "View.MemoryView":948
21115  * cdef int ndim = memslice.memview.view.ndim
21116  *
21117  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
21118  * cdef Py_ssize_t *strides = memslice.strides
21119  *
21120  */
21121  __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
21122  __pyx_t_2 = __pyx_v_memslice->shape;
21123  __pyx_v_shape = __pyx_t_2;
21124 
21125  /* "View.MemoryView":949
21126  *
21127  * cdef Py_ssize_t *shape = memslice.shape
21128  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
21129  *
21130  *
21131  */
21132  __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
21133  __pyx_t_2 = __pyx_v_memslice->strides;
21134  __pyx_v_strides = __pyx_t_2;
21135 
21136  /* "View.MemoryView":953
21137  *
21138  * cdef int i, j
21139  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
21140  * j = ndim - 1 - i
21141  * strides[i], strides[j] = strides[j], strides[i]
21142  */
21143  __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
21144  __pyx_t_3 = (__pyx_v_ndim / 2);
21145  __pyx_t_4 = __pyx_t_3;
21146  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
21147  __pyx_v_i = __pyx_t_1;
21148 
21149  /* "View.MemoryView":954
21150  * cdef int i, j
21151  * for i in range(ndim / 2):
21152  * j = ndim - 1 - i # <<<<<<<<<<<<<<
21153  * strides[i], strides[j] = strides[j], strides[i]
21154  * shape[i], shape[j] = shape[j], shape[i]
21155  */
21156  __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
21157  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
21158 
21159  /* "View.MemoryView":955
21160  * for i in range(ndim / 2):
21161  * j = ndim - 1 - i
21162  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
21163  * shape[i], shape[j] = shape[j], shape[i]
21164  *
21165  */
21166  __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
21167  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
21168  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
21169  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
21170  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
21171 
21172  /* "View.MemoryView":956
21173  * j = ndim - 1 - i
21174  * strides[i], strides[j] = strides[j], strides[i]
21175  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
21176  *
21177  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
21178  */
21179  __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
21180  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
21181  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
21182  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
21183  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
21184 
21185  /* "View.MemoryView":958
21186  * shape[i], shape[j] = shape[j], shape[i]
21187  *
21188  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
21189  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
21190  *
21191  */
21192  __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
21193  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
21194  if (!__pyx_t_8) {
21195  } else {
21196  __pyx_t_7 = __pyx_t_8;
21197  goto __pyx_L6_bool_binop_done;
21198  }
21199  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
21200  __pyx_t_7 = __pyx_t_8;
21201  __pyx_L6_bool_binop_done:;
21202  if (__pyx_t_7) {
21203 
21204  /* "View.MemoryView":959
21205  *
21206  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
21207  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
21208  *
21209  * return 1
21210  */
21211  __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
21212  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
21213 
21214  /* "View.MemoryView":958
21215  * shape[i], shape[j] = shape[j], shape[i]
21216  *
21217  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
21218  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
21219  *
21220  */
21221  }
21222  }
21223 
21224  /* "View.MemoryView":961
21225  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
21226  *
21227  * return 1 # <<<<<<<<<<<<<<
21228  *
21229  *
21230  */
21231  __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
21232  __pyx_r = 1;
21233  goto __pyx_L0;
21234 
21235  /* "View.MemoryView":945
21236  *
21237  * @cname('__pyx_memslice_transpose')
21238  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
21239  * cdef int ndim = memslice.memview.view.ndim
21240  *
21241  */
21242 
21243  /* function exit code */
21244  __pyx_L1_error:;
21245  {
21246  #ifdef WITH_THREAD
21247  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21248  #endif
21249  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21250  #ifdef WITH_THREAD
21251  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21252  #endif
21253  }
21254  __pyx_r = 0;
21255  __pyx_L0:;
21256  __Pyx_TraceReturn(Py_None, 1);
21257  return __pyx_r;
21258 }
21259 
21260 /* "View.MemoryView":978
21261  * cdef int (*to_dtype_func)(char *, object) except 0
21262  *
21263  * def __dealloc__(self): # <<<<<<<<<<<<<<
21264  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21265  *
21266  */
21267 
21268 /* Python wrapper */
21269 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
21270 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
21271  __Pyx_RefNannyDeclarations
21272  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
21273  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21274 
21275  /* function exit code */
21276  __Pyx_RefNannyFinishContext();
21277 }
21278 
21279 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21280  __Pyx_TraceDeclarations
21281  __Pyx_RefNannyDeclarations
21282  int __pyx_lineno = 0;
21283  const char *__pyx_filename = NULL;
21284  int __pyx_clineno = 0;
21285  __Pyx_RefNannySetupContext("__dealloc__", 0);
21286  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
21287 
21288  /* "View.MemoryView":979
21289  *
21290  * def __dealloc__(self):
21291  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
21292  *
21293  * cdef convert_item_to_object(self, char *itemp):
21294  */
21295  __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
21296  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
21297 
21298  /* "View.MemoryView":978
21299  * cdef int (*to_dtype_func)(char *, object) except 0
21300  *
21301  * def __dealloc__(self): # <<<<<<<<<<<<<<
21302  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21303  *
21304  */
21305 
21306  /* function exit code */
21307  goto __pyx_L0;
21308  __pyx_L1_error:;
21309  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21310  __pyx_L0:;
21311  __Pyx_TraceReturn(Py_None, 0);
21312  __Pyx_RefNannyFinishContext();
21313 }
21314 
21315 /* "View.MemoryView":981
21316  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21317  *
21318  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
21319  * if self.to_object_func != NULL:
21320  * return self.to_object_func(itemp)
21321  */
21322 
21323 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
21324  PyObject *__pyx_r = NULL;
21325  __Pyx_TraceDeclarations
21326  __Pyx_RefNannyDeclarations
21327  int __pyx_t_1;
21328  PyObject *__pyx_t_2 = NULL;
21329  int __pyx_lineno = 0;
21330  const char *__pyx_filename = NULL;
21331  int __pyx_clineno = 0;
21332  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
21333  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
21334 
21335  /* "View.MemoryView":982
21336  *
21337  * cdef convert_item_to_object(self, char *itemp):
21338  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
21339  * return self.to_object_func(itemp)
21340  * else:
21341  */
21342  __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
21343  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
21344  if (__pyx_t_1) {
21345 
21346  /* "View.MemoryView":983
21347  * cdef convert_item_to_object(self, char *itemp):
21348  * if self.to_object_func != NULL:
21349  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
21350  * else:
21351  * return memoryview.convert_item_to_object(self, itemp)
21352  */
21353  __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
21354  __Pyx_XDECREF(__pyx_r);
21355  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
21356  __Pyx_GOTREF(__pyx_t_2);
21357  __pyx_r = __pyx_t_2;
21358  __pyx_t_2 = 0;
21359  goto __pyx_L0;
21360 
21361  /* "View.MemoryView":982
21362  *
21363  * cdef convert_item_to_object(self, char *itemp):
21364  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
21365  * return self.to_object_func(itemp)
21366  * else:
21367  */
21368  }
21369 
21370  /* "View.MemoryView":985
21371  * return self.to_object_func(itemp)
21372  * else:
21373  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
21374  *
21375  * cdef assign_item_from_object(self, char *itemp, object value):
21376  */
21377  __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
21378  /*else*/ {
21379  __Pyx_XDECREF(__pyx_r);
21380  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
21381  __Pyx_GOTREF(__pyx_t_2);
21382  __pyx_r = __pyx_t_2;
21383  __pyx_t_2 = 0;
21384  goto __pyx_L0;
21385  }
21386 
21387  /* "View.MemoryView":981
21388  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21389  *
21390  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
21391  * if self.to_object_func != NULL:
21392  * return self.to_object_func(itemp)
21393  */
21394 
21395  /* function exit code */
21396  __pyx_L1_error:;
21397  __Pyx_XDECREF(__pyx_t_2);
21398  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21399  __pyx_r = 0;
21400  __pyx_L0:;
21401  __Pyx_XGIVEREF(__pyx_r);
21402  __Pyx_TraceReturn(__pyx_r, 0);
21403  __Pyx_RefNannyFinishContext();
21404  return __pyx_r;
21405 }
21406 
21407 /* "View.MemoryView":987
21408  * return memoryview.convert_item_to_object(self, itemp)
21409  *
21410  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
21411  * if self.to_dtype_func != NULL:
21412  * self.to_dtype_func(itemp, value)
21413  */
21414 
21415 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
21416  PyObject *__pyx_r = NULL;
21417  __Pyx_TraceDeclarations
21418  __Pyx_RefNannyDeclarations
21419  int __pyx_t_1;
21420  int __pyx_t_2;
21421  PyObject *__pyx_t_3 = NULL;
21422  int __pyx_lineno = 0;
21423  const char *__pyx_filename = NULL;
21424  int __pyx_clineno = 0;
21425  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
21426  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
21427 
21428  /* "View.MemoryView":988
21429  *
21430  * cdef assign_item_from_object(self, char *itemp, object value):
21431  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
21432  * self.to_dtype_func(itemp, value)
21433  * else:
21434  */
21435  __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
21436  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
21437  if (__pyx_t_1) {
21438 
21439  /* "View.MemoryView":989
21440  * cdef assign_item_from_object(self, char *itemp, object value):
21441  * if self.to_dtype_func != NULL:
21442  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
21443  * else:
21444  * memoryview.assign_item_from_object(self, itemp, value)
21445  */
21446  __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
21447  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
21448 
21449  /* "View.MemoryView":988
21450  *
21451  * cdef assign_item_from_object(self, char *itemp, object value):
21452  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
21453  * self.to_dtype_func(itemp, value)
21454  * else:
21455  */
21456  goto __pyx_L3;
21457  }
21458 
21459  /* "View.MemoryView":991
21460  * self.to_dtype_func(itemp, value)
21461  * else:
21462  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
21463  *
21464  * @property
21465  */
21466  __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
21467  /*else*/ {
21468  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
21469  __Pyx_GOTREF(__pyx_t_3);
21470  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21471  }
21472  __pyx_L3:;
21473 
21474  /* "View.MemoryView":987
21475  * return memoryview.convert_item_to_object(self, itemp)
21476  *
21477  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
21478  * if self.to_dtype_func != NULL:
21479  * self.to_dtype_func(itemp, value)
21480  */
21481 
21482  /* function exit code */
21483  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21484  goto __pyx_L0;
21485  __pyx_L1_error:;
21486  __Pyx_XDECREF(__pyx_t_3);
21487  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21488  __pyx_r = 0;
21489  __pyx_L0:;
21490  __Pyx_XGIVEREF(__pyx_r);
21491  __Pyx_TraceReturn(__pyx_r, 0);
21492  __Pyx_RefNannyFinishContext();
21493  return __pyx_r;
21494 }
21495 
21496 /* "View.MemoryView":994
21497  *
21498  * @property
21499  * def base(self): # <<<<<<<<<<<<<<
21500  * return self.from_object
21501  *
21502  */
21503 
21504 /* Python wrapper */
21505 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
21506 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
21507  PyObject *__pyx_r = 0;
21508  __Pyx_RefNannyDeclarations
21509  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
21510  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21511 
21512  /* function exit code */
21513  __Pyx_RefNannyFinishContext();
21514  return __pyx_r;
21515 }
21516 
21517 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21518  PyObject *__pyx_r = NULL;
21519  __Pyx_TraceDeclarations
21520  __Pyx_RefNannyDeclarations
21521  int __pyx_lineno = 0;
21522  const char *__pyx_filename = NULL;
21523  int __pyx_clineno = 0;
21524  __Pyx_RefNannySetupContext("__get__", 0);
21525  __Pyx_TraceCall("__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
21526 
21527  /* "View.MemoryView":995
21528  * @property
21529  * def base(self):
21530  * return self.from_object # <<<<<<<<<<<<<<
21531  *
21532  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
21533  */
21534  __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
21535  __Pyx_XDECREF(__pyx_r);
21536  __Pyx_INCREF(__pyx_v_self->from_object);
21537  __pyx_r = __pyx_v_self->from_object;
21538  goto __pyx_L0;
21539 
21540  /* "View.MemoryView":994
21541  *
21542  * @property
21543  * def base(self): # <<<<<<<<<<<<<<
21544  * return self.from_object
21545  *
21546  */
21547 
21548  /* function exit code */
21549  __pyx_L1_error:;
21550  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21551  __pyx_r = NULL;
21552  __pyx_L0:;
21553  __Pyx_XGIVEREF(__pyx_r);
21554  __Pyx_TraceReturn(__pyx_r, 0);
21555  __Pyx_RefNannyFinishContext();
21556  return __pyx_r;
21557 }
21558 
21559 /* "(tree fragment)":1
21560  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
21561  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21562  * def __setstate_cython__(self, __pyx_state):
21563  */
21564 
21565 /* Python wrapper */
21566 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
21567 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
21568 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
21569  PyObject *__pyx_r = 0;
21570  __Pyx_RefNannyDeclarations
21571  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
21572  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21573 
21574  /* function exit code */
21575  __Pyx_RefNannyFinishContext();
21576  return __pyx_r;
21577 }
21578 
21579 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21580  PyObject *__pyx_r = NULL;
21581  __Pyx_TraceDeclarations
21582  __Pyx_RefNannyDeclarations
21583  PyObject *__pyx_t_1 = NULL;
21584  int __pyx_lineno = 0;
21585  const char *__pyx_filename = NULL;
21586  int __pyx_clineno = 0;
21587  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
21588  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
21589 
21590  /* "(tree fragment)":2
21591  * def __reduce_cython__(self):
21592  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21593  * def __setstate_cython__(self, __pyx_state):
21594  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21595  */
21596  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
21597  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
21598  __Pyx_GOTREF(__pyx_t_1);
21599  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21600  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21601  __PYX_ERR(1, 2, __pyx_L1_error)
21602 
21603  /* "(tree fragment)":1
21604  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
21605  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21606  * def __setstate_cython__(self, __pyx_state):
21607  */
21608 
21609  /* function exit code */
21610  __pyx_L1_error:;
21611  __Pyx_XDECREF(__pyx_t_1);
21612  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21613  __pyx_r = NULL;
21614  __Pyx_XGIVEREF(__pyx_r);
21615  __Pyx_TraceReturn(__pyx_r, 0);
21616  __Pyx_RefNannyFinishContext();
21617  return __pyx_r;
21618 }
21619 
21620 /* "(tree fragment)":3
21621  * def __reduce_cython__(self):
21622  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21623  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
21624  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21625  */
21626 
21627 /* Python wrapper */
21628 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
21629 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
21630 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
21631  PyObject *__pyx_r = 0;
21632  __Pyx_RefNannyDeclarations
21633  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
21634  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
21635 
21636  /* function exit code */
21637  __Pyx_RefNannyFinishContext();
21638  return __pyx_r;
21639 }
21640 
21641 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
21642  PyObject *__pyx_r = NULL;
21643  __Pyx_TraceDeclarations
21644  __Pyx_RefNannyDeclarations
21645  PyObject *__pyx_t_1 = NULL;
21646  int __pyx_lineno = 0;
21647  const char *__pyx_filename = NULL;
21648  int __pyx_clineno = 0;
21649  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
21650  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
21651 
21652  /* "(tree fragment)":4
21653  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21654  * def __setstate_cython__(self, __pyx_state):
21655  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21656  */
21657  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
21658  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
21659  __Pyx_GOTREF(__pyx_t_1);
21660  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21661  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21662  __PYX_ERR(1, 4, __pyx_L1_error)
21663 
21664  /* "(tree fragment)":3
21665  * def __reduce_cython__(self):
21666  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21667  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
21668  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21669  */
21670 
21671  /* function exit code */
21672  __pyx_L1_error:;
21673  __Pyx_XDECREF(__pyx_t_1);
21674  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21675  __pyx_r = NULL;
21676  __Pyx_XGIVEREF(__pyx_r);
21677  __Pyx_TraceReturn(__pyx_r, 0);
21678  __Pyx_RefNannyFinishContext();
21679  return __pyx_r;
21680 }
21681 
21682 /* "View.MemoryView":1001
21683  *
21684  * @cname('__pyx_memoryview_fromslice')
21685  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
21686  * int ndim,
21687  * object (*to_object_func)(char *),
21688  */
21689 
21690 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
21691  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
21692  Py_ssize_t __pyx_v_suboffset;
21693  PyObject *__pyx_v_length = NULL;
21694  PyObject *__pyx_r = NULL;
21695  __Pyx_TraceDeclarations
21696  __Pyx_RefNannyDeclarations
21697  int __pyx_t_1;
21698  PyObject *__pyx_t_2 = NULL;
21699  PyObject *__pyx_t_3 = NULL;
21700  __Pyx_TypeInfo *__pyx_t_4;
21701  Py_buffer __pyx_t_5;
21702  Py_ssize_t *__pyx_t_6;
21703  Py_ssize_t *__pyx_t_7;
21704  Py_ssize_t *__pyx_t_8;
21705  Py_ssize_t __pyx_t_9;
21706  int __pyx_lineno = 0;
21707  const char *__pyx_filename = NULL;
21708  int __pyx_clineno = 0;
21709  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
21710  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
21711 
21712  /* "View.MemoryView":1009
21713  * cdef _memoryviewslice result
21714  *
21715  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
21716  * return None
21717  *
21718  */
21719  __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
21720  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
21721  if (__pyx_t_1) {
21722 
21723  /* "View.MemoryView":1010
21724  *
21725  * if <PyObject *> memviewslice.memview == Py_None:
21726  * return None # <<<<<<<<<<<<<<
21727  *
21728  *
21729  */
21730  __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
21731  __Pyx_XDECREF(__pyx_r);
21732  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21733  goto __pyx_L0;
21734 
21735  /* "View.MemoryView":1009
21736  * cdef _memoryviewslice result
21737  *
21738  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
21739  * return None
21740  *
21741  */
21742  }
21743 
21744  /* "View.MemoryView":1015
21745  *
21746  *
21747  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
21748  *
21749  * result.from_slice = memviewslice
21750  */
21751  __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
21752  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
21753  __Pyx_GOTREF(__pyx_t_2);
21754  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
21755  __Pyx_GOTREF(__pyx_t_3);
21756  __Pyx_INCREF(Py_None);
21757  __Pyx_GIVEREF(Py_None);
21758  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
21759  __Pyx_INCREF(__pyx_int_0);
21760  __Pyx_GIVEREF(__pyx_int_0);
21761  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
21762  __Pyx_GIVEREF(__pyx_t_2);
21763  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
21764  __pyx_t_2 = 0;
21765  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
21766  __Pyx_GOTREF(__pyx_t_2);
21767  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21768  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
21769  __pyx_t_2 = 0;
21770 
21771  /* "View.MemoryView":1017
21772  * result = _memoryviewslice(None, 0, dtype_is_object)
21773  *
21774  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
21775  * __PYX_INC_MEMVIEW(&memviewslice, 1)
21776  *
21777  */
21778  __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
21779  __pyx_v_result->from_slice = __pyx_v_memviewslice;
21780 
21781  /* "View.MemoryView":1018
21782  *
21783  * result.from_slice = memviewslice
21784  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
21785  *
21786  * result.from_object = (<memoryview> memviewslice.memview).base
21787  */
21788  __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
21789  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
21790 
21791  /* "View.MemoryView":1020
21792  * __PYX_INC_MEMVIEW(&memviewslice, 1)
21793  *
21794  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
21795  * result.typeinfo = memviewslice.memview.typeinfo
21796  *
21797  */
21798  __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
21799  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
21800  __Pyx_GOTREF(__pyx_t_2);
21801  __Pyx_GIVEREF(__pyx_t_2);
21802  __Pyx_GOTREF(__pyx_v_result->from_object);
21803  __Pyx_DECREF(__pyx_v_result->from_object);
21804  __pyx_v_result->from_object = __pyx_t_2;
21805  __pyx_t_2 = 0;
21806 
21807  /* "View.MemoryView":1021
21808  *
21809  * result.from_object = (<memoryview> memviewslice.memview).base
21810  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
21811  *
21812  * result.view = memviewslice.memview.view
21813  */
21814  __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
21815  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
21816  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
21817 
21818  /* "View.MemoryView":1023
21819  * result.typeinfo = memviewslice.memview.typeinfo
21820  *
21821  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
21822  * result.view.buf = <void *> memviewslice.data
21823  * result.view.ndim = ndim
21824  */
21825  __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
21826  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
21827  __pyx_v_result->__pyx_base.view = __pyx_t_5;
21828 
21829  /* "View.MemoryView":1024
21830  *
21831  * result.view = memviewslice.memview.view
21832  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
21833  * result.view.ndim = ndim
21834  * (<__pyx_buffer *> &result.view).obj = Py_None
21835  */
21836  __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
21837  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
21838 
21839  /* "View.MemoryView":1025
21840  * result.view = memviewslice.memview.view
21841  * result.view.buf = <void *> memviewslice.data
21842  * result.view.ndim = ndim # <<<<<<<<<<<<<<
21843  * (<__pyx_buffer *> &result.view).obj = Py_None
21844  * Py_INCREF(Py_None)
21845  */
21846  __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
21847  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
21848 
21849  /* "View.MemoryView":1026
21850  * result.view.buf = <void *> memviewslice.data
21851  * result.view.ndim = ndim
21852  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
21853  * Py_INCREF(Py_None)
21854  *
21855  */
21856  __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
21857  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
21858 
21859  /* "View.MemoryView":1027
21860  * result.view.ndim = ndim
21861  * (<__pyx_buffer *> &result.view).obj = Py_None
21862  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
21863  *
21864  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
21865  */
21866  __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
21867  Py_INCREF(Py_None);
21868 
21869  /* "View.MemoryView":1029
21870  * Py_INCREF(Py_None)
21871  *
21872  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
21873  * result.flags = PyBUF_RECORDS
21874  * else:
21875  */
21876  __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
21877  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
21878  if (__pyx_t_1) {
21879 
21880  /* "View.MemoryView":1030
21881  *
21882  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
21883  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
21884  * else:
21885  * result.flags = PyBUF_RECORDS_RO
21886  */
21887  __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
21888  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
21889 
21890  /* "View.MemoryView":1029
21891  * Py_INCREF(Py_None)
21892  *
21893  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
21894  * result.flags = PyBUF_RECORDS
21895  * else:
21896  */
21897  goto __pyx_L4;
21898  }
21899 
21900  /* "View.MemoryView":1032
21901  * result.flags = PyBUF_RECORDS
21902  * else:
21903  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
21904  *
21905  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
21906  */
21907  __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
21908  /*else*/ {
21909  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
21910  }
21911  __pyx_L4:;
21912 
21913  /* "View.MemoryView":1034
21914  * result.flags = PyBUF_RECORDS_RO
21915  *
21916  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
21917  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
21918  *
21919  */
21920  __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
21921  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
21922 
21923  /* "View.MemoryView":1035
21924  *
21925  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
21926  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
21927  *
21928  *
21929  */
21930  __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
21931  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
21932 
21933  /* "View.MemoryView":1038
21934  *
21935  *
21936  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
21937  * for suboffset in result.from_slice.suboffsets[:ndim]:
21938  * if suboffset >= 0:
21939  */
21940  __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
21941  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
21942 
21943  /* "View.MemoryView":1039
21944  *
21945  * result.view.suboffsets = NULL
21946  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
21947  * if suboffset >= 0:
21948  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21949  */
21950  __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
21951  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
21952  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
21953  __pyx_t_6 = __pyx_t_8;
21954  __pyx_v_suboffset = (__pyx_t_6[0]);
21955 
21956  /* "View.MemoryView":1040
21957  * result.view.suboffsets = NULL
21958  * for suboffset in result.from_slice.suboffsets[:ndim]:
21959  * if suboffset >= 0: # <<<<<<<<<<<<<<
21960  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21961  * break
21962  */
21963  __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
21964  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
21965  if (__pyx_t_1) {
21966 
21967  /* "View.MemoryView":1041
21968  * for suboffset in result.from_slice.suboffsets[:ndim]:
21969  * if suboffset >= 0:
21970  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
21971  * break
21972  *
21973  */
21974  __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
21975  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
21976 
21977  /* "View.MemoryView":1042
21978  * if suboffset >= 0:
21979  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21980  * break # <<<<<<<<<<<<<<
21981  *
21982  * result.view.len = result.view.itemsize
21983  */
21984  __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
21985  goto __pyx_L6_break;
21986 
21987  /* "View.MemoryView":1040
21988  * result.view.suboffsets = NULL
21989  * for suboffset in result.from_slice.suboffsets[:ndim]:
21990  * if suboffset >= 0: # <<<<<<<<<<<<<<
21991  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21992  * break
21993  */
21994  }
21995  }
21996  __pyx_L6_break:;
21997 
21998  /* "View.MemoryView":1044
21999  * break
22000  *
22001  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
22002  * for length in result.view.shape[:ndim]:
22003  * result.view.len *= length
22004  */
22005  __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
22006  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
22007  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
22008 
22009  /* "View.MemoryView":1045
22010  *
22011  * result.view.len = result.view.itemsize
22012  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
22013  * result.view.len *= length
22014  *
22015  */
22016  __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
22017  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
22018  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
22019  __pyx_t_6 = __pyx_t_8;
22020  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
22021  __Pyx_GOTREF(__pyx_t_2);
22022  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
22023  __pyx_t_2 = 0;
22024 
22025  /* "View.MemoryView":1046
22026  * result.view.len = result.view.itemsize
22027  * for length in result.view.shape[:ndim]:
22028  * result.view.len *= length # <<<<<<<<<<<<<<
22029  *
22030  * result.to_object_func = to_object_func
22031  */
22032  __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
22033  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
22034  __Pyx_GOTREF(__pyx_t_2);
22035  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
22036  __Pyx_GOTREF(__pyx_t_3);
22037  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22038  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
22039  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22040  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
22041  }
22042 
22043  /* "View.MemoryView":1048
22044  * result.view.len *= length
22045  *
22046  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
22047  * result.to_dtype_func = to_dtype_func
22048  *
22049  */
22050  __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
22051  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
22052 
22053  /* "View.MemoryView":1049
22054  *
22055  * result.to_object_func = to_object_func
22056  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
22057  *
22058  * return result
22059  */
22060  __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
22061  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
22062 
22063  /* "View.MemoryView":1051
22064  * result.to_dtype_func = to_dtype_func
22065  *
22066  * return result # <<<<<<<<<<<<<<
22067  *
22068  * @cname('__pyx_memoryview_get_slice_from_memoryview')
22069  */
22070  __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
22071  __Pyx_XDECREF(__pyx_r);
22072  __Pyx_INCREF(((PyObject *)__pyx_v_result));
22073  __pyx_r = ((PyObject *)__pyx_v_result);
22074  goto __pyx_L0;
22075 
22076  /* "View.MemoryView":1001
22077  *
22078  * @cname('__pyx_memoryview_fromslice')
22079  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
22080  * int ndim,
22081  * object (*to_object_func)(char *),
22082  */
22083 
22084  /* function exit code */
22085  __pyx_L1_error:;
22086  __Pyx_XDECREF(__pyx_t_2);
22087  __Pyx_XDECREF(__pyx_t_3);
22088  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22089  __pyx_r = 0;
22090  __pyx_L0:;
22091  __Pyx_XDECREF((PyObject *)__pyx_v_result);
22092  __Pyx_XDECREF(__pyx_v_length);
22093  __Pyx_XGIVEREF(__pyx_r);
22094  __Pyx_TraceReturn(__pyx_r, 0);
22095  __Pyx_RefNannyFinishContext();
22096  return __pyx_r;
22097 }
22098 
22099 /* "View.MemoryView":1054
22100  *
22101  * @cname('__pyx_memoryview_get_slice_from_memoryview')
22102  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
22103  * __Pyx_memviewslice *mslice) except NULL:
22104  * cdef _memoryviewslice obj
22105  */
22106 
22107 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
22108  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
22109  __Pyx_memviewslice *__pyx_r;
22110  __Pyx_TraceDeclarations
22111  __Pyx_RefNannyDeclarations
22112  int __pyx_t_1;
22113  int __pyx_t_2;
22114  PyObject *__pyx_t_3 = NULL;
22115  int __pyx_lineno = 0;
22116  const char *__pyx_filename = NULL;
22117  int __pyx_clineno = 0;
22118  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
22119  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
22120 
22121  /* "View.MemoryView":1057
22122  * __Pyx_memviewslice *mslice) except NULL:
22123  * cdef _memoryviewslice obj
22124  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
22125  * obj = memview
22126  * return &obj.from_slice
22127  */
22128  __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
22129  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
22130  __pyx_t_2 = (__pyx_t_1 != 0);
22131  if (__pyx_t_2) {
22132 
22133  /* "View.MemoryView":1058
22134  * cdef _memoryviewslice obj
22135  * if isinstance(memview, _memoryviewslice):
22136  * obj = memview # <<<<<<<<<<<<<<
22137  * return &obj.from_slice
22138  * else:
22139  */
22140  __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
22141  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
22142  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
22143  __Pyx_INCREF(__pyx_t_3);
22144  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
22145  __pyx_t_3 = 0;
22146 
22147  /* "View.MemoryView":1059
22148  * if isinstance(memview, _memoryviewslice):
22149  * obj = memview
22150  * return &obj.from_slice # <<<<<<<<<<<<<<
22151  * else:
22152  * slice_copy(memview, mslice)
22153  */
22154  __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
22155  __pyx_r = (&__pyx_v_obj->from_slice);
22156  goto __pyx_L0;
22157 
22158  /* "View.MemoryView":1057
22159  * __Pyx_memviewslice *mslice) except NULL:
22160  * cdef _memoryviewslice obj
22161  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
22162  * obj = memview
22163  * return &obj.from_slice
22164  */
22165  }
22166 
22167  /* "View.MemoryView":1061
22168  * return &obj.from_slice
22169  * else:
22170  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
22171  * return mslice
22172  *
22173  */
22174  __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
22175  /*else*/ {
22176  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
22177 
22178  /* "View.MemoryView":1062
22179  * else:
22180  * slice_copy(memview, mslice)
22181  * return mslice # <<<<<<<<<<<<<<
22182  *
22183  * @cname('__pyx_memoryview_slice_copy')
22184  */
22185  __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
22186  __pyx_r = __pyx_v_mslice;
22187  goto __pyx_L0;
22188  }
22189 
22190  /* "View.MemoryView":1054
22191  *
22192  * @cname('__pyx_memoryview_get_slice_from_memoryview')
22193  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
22194  * __Pyx_memviewslice *mslice) except NULL:
22195  * cdef _memoryviewslice obj
22196  */
22197 
22198  /* function exit code */
22199  __pyx_L1_error:;
22200  __Pyx_XDECREF(__pyx_t_3);
22201  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
22202  __pyx_r = NULL;
22203  __pyx_L0:;
22204  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
22205  __Pyx_TraceReturn(Py_None, 0);
22206  __Pyx_RefNannyFinishContext();
22207  return __pyx_r;
22208 }
22209 
22210 /* "View.MemoryView":1065
22211  *
22212  * @cname('__pyx_memoryview_slice_copy')
22213  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
22214  * cdef int dim
22215  * cdef (Py_ssize_t*) shape, strides, suboffsets
22216  */
22217 
22218 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
22219  int __pyx_v_dim;
22220  Py_ssize_t *__pyx_v_shape;
22221  Py_ssize_t *__pyx_v_strides;
22222  Py_ssize_t *__pyx_v_suboffsets;
22223  __Pyx_TraceDeclarations
22224  __Pyx_RefNannyDeclarations
22225  Py_ssize_t *__pyx_t_1;
22226  int __pyx_t_2;
22227  int __pyx_t_3;
22228  int __pyx_t_4;
22229  Py_ssize_t __pyx_t_5;
22230  int __pyx_lineno = 0;
22231  const char *__pyx_filename = NULL;
22232  int __pyx_clineno = 0;
22233  __Pyx_RefNannySetupContext("slice_copy", 0);
22234  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
22235 
22236  /* "View.MemoryView":1069
22237  * cdef (Py_ssize_t*) shape, strides, suboffsets
22238  *
22239  * shape = memview.view.shape # <<<<<<<<<<<<<<
22240  * strides = memview.view.strides
22241  * suboffsets = memview.view.suboffsets
22242  */
22243  __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
22244  __pyx_t_1 = __pyx_v_memview->view.shape;
22245  __pyx_v_shape = __pyx_t_1;
22246 
22247  /* "View.MemoryView":1070
22248  *
22249  * shape = memview.view.shape
22250  * strides = memview.view.strides # <<<<<<<<<<<<<<
22251  * suboffsets = memview.view.suboffsets
22252  *
22253  */
22254  __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
22255  __pyx_t_1 = __pyx_v_memview->view.strides;
22256  __pyx_v_strides = __pyx_t_1;
22257 
22258  /* "View.MemoryView":1071
22259  * shape = memview.view.shape
22260  * strides = memview.view.strides
22261  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
22262  *
22263  * dst.memview = <__pyx_memoryview *> memview
22264  */
22265  __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
22266  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
22267  __pyx_v_suboffsets = __pyx_t_1;
22268 
22269  /* "View.MemoryView":1073
22270  * suboffsets = memview.view.suboffsets
22271  *
22272  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
22273  * dst.data = <char *> memview.view.buf
22274  *
22275  */
22276  __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
22277  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
22278 
22279  /* "View.MemoryView":1074
22280  *
22281  * dst.memview = <__pyx_memoryview *> memview
22282  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
22283  *
22284  * for dim in range(memview.view.ndim):
22285  */
22286  __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
22287  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
22288 
22289  /* "View.MemoryView":1076
22290  * dst.data = <char *> memview.view.buf
22291  *
22292  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
22293  * dst.shape[dim] = shape[dim]
22294  * dst.strides[dim] = strides[dim]
22295  */
22296  __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
22297  __pyx_t_2 = __pyx_v_memview->view.ndim;
22298  __pyx_t_3 = __pyx_t_2;
22299  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22300  __pyx_v_dim = __pyx_t_4;
22301 
22302  /* "View.MemoryView":1077
22303  *
22304  * for dim in range(memview.view.ndim):
22305  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
22306  * dst.strides[dim] = strides[dim]
22307  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
22308  */
22309  __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
22310  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
22311 
22312  /* "View.MemoryView":1078
22313  * for dim in range(memview.view.ndim):
22314  * dst.shape[dim] = shape[dim]
22315  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
22316  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
22317  *
22318  */
22319  __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
22320  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
22321 
22322  /* "View.MemoryView":1079
22323  * dst.shape[dim] = shape[dim]
22324  * dst.strides[dim] = strides[dim]
22325  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
22326  *
22327  * @cname('__pyx_memoryview_copy_object')
22328  */
22329  __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
22330  if ((__pyx_v_suboffsets != 0)) {
22331  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
22332  } else {
22333  __pyx_t_5 = -1L;
22334  }
22335  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
22336  }
22337 
22338  /* "View.MemoryView":1065
22339  *
22340  * @cname('__pyx_memoryview_slice_copy')
22341  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
22342  * cdef int dim
22343  * cdef (Py_ssize_t*) shape, strides, suboffsets
22344  */
22345 
22346  /* function exit code */
22347  goto __pyx_L0;
22348  __pyx_L1_error:;
22349  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
22350  __pyx_L0:;
22351  __Pyx_TraceReturn(Py_None, 0);
22352  __Pyx_RefNannyFinishContext();
22353 }
22354 
22355 /* "View.MemoryView":1082
22356  *
22357  * @cname('__pyx_memoryview_copy_object')
22358  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
22359  * "Create a new memoryview object"
22360  * cdef __Pyx_memviewslice memviewslice
22361  */
22362 
22363 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
22364  __Pyx_memviewslice __pyx_v_memviewslice;
22365  PyObject *__pyx_r = NULL;
22366  __Pyx_TraceDeclarations
22367  __Pyx_RefNannyDeclarations
22368  PyObject *__pyx_t_1 = NULL;
22369  int __pyx_lineno = 0;
22370  const char *__pyx_filename = NULL;
22371  int __pyx_clineno = 0;
22372  __Pyx_RefNannySetupContext("memoryview_copy", 0);
22373  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
22374 
22375  /* "View.MemoryView":1085
22376  * "Create a new memoryview object"
22377  * cdef __Pyx_memviewslice memviewslice
22378  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
22379  * return memoryview_copy_from_slice(memview, &memviewslice)
22380  *
22381  */
22382  __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
22383  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
22384 
22385  /* "View.MemoryView":1086
22386  * cdef __Pyx_memviewslice memviewslice
22387  * slice_copy(memview, &memviewslice)
22388  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
22389  *
22390  * @cname('__pyx_memoryview_copy_object_from_slice')
22391  */
22392  __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
22393  __Pyx_XDECREF(__pyx_r);
22394  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
22395  __Pyx_GOTREF(__pyx_t_1);
22396  __pyx_r = __pyx_t_1;
22397  __pyx_t_1 = 0;
22398  goto __pyx_L0;
22399 
22400  /* "View.MemoryView":1082
22401  *
22402  * @cname('__pyx_memoryview_copy_object')
22403  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
22404  * "Create a new memoryview object"
22405  * cdef __Pyx_memviewslice memviewslice
22406  */
22407 
22408  /* function exit code */
22409  __pyx_L1_error:;
22410  __Pyx_XDECREF(__pyx_t_1);
22411  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
22412  __pyx_r = 0;
22413  __pyx_L0:;
22414  __Pyx_XGIVEREF(__pyx_r);
22415  __Pyx_TraceReturn(__pyx_r, 0);
22416  __Pyx_RefNannyFinishContext();
22417  return __pyx_r;
22418 }
22419 
22420 /* "View.MemoryView":1089
22421  *
22422  * @cname('__pyx_memoryview_copy_object_from_slice')
22423  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
22424  * """
22425  * Create a new memoryview object from a given memoryview object and slice.
22426  */
22427 
22428 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
22429  PyObject *(*__pyx_v_to_object_func)(char *);
22430  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
22431  PyObject *__pyx_r = NULL;
22432  __Pyx_TraceDeclarations
22433  __Pyx_RefNannyDeclarations
22434  int __pyx_t_1;
22435  int __pyx_t_2;
22436  PyObject *(*__pyx_t_3)(char *);
22437  int (*__pyx_t_4)(char *, PyObject *);
22438  PyObject *__pyx_t_5 = NULL;
22439  int __pyx_lineno = 0;
22440  const char *__pyx_filename = NULL;
22441  int __pyx_clineno = 0;
22442  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
22443  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
22444 
22445  /* "View.MemoryView":1096
22446  * cdef int (*to_dtype_func)(char *, object) except 0
22447  *
22448  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
22449  * to_object_func = (<_memoryviewslice> memview).to_object_func
22450  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22451  */
22452  __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
22453  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
22454  __pyx_t_2 = (__pyx_t_1 != 0);
22455  if (__pyx_t_2) {
22456 
22457  /* "View.MemoryView":1097
22458  *
22459  * if isinstance(memview, _memoryviewslice):
22460  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
22461  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22462  * else:
22463  */
22464  __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
22465  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
22466  __pyx_v_to_object_func = __pyx_t_3;
22467 
22468  /* "View.MemoryView":1098
22469  * if isinstance(memview, _memoryviewslice):
22470  * to_object_func = (<_memoryviewslice> memview).to_object_func
22471  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
22472  * else:
22473  * to_object_func = NULL
22474  */
22475  __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
22476  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
22477  __pyx_v_to_dtype_func = __pyx_t_4;
22478 
22479  /* "View.MemoryView":1096
22480  * cdef int (*to_dtype_func)(char *, object) except 0
22481  *
22482  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
22483  * to_object_func = (<_memoryviewslice> memview).to_object_func
22484  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22485  */
22486  goto __pyx_L3;
22487  }
22488 
22489  /* "View.MemoryView":1100
22490  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22491  * else:
22492  * to_object_func = NULL # <<<<<<<<<<<<<<
22493  * to_dtype_func = NULL
22494  *
22495  */
22496  __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
22497  /*else*/ {
22498  __pyx_v_to_object_func = NULL;
22499 
22500  /* "View.MemoryView":1101
22501  * else:
22502  * to_object_func = NULL
22503  * to_dtype_func = NULL # <<<<<<<<<<<<<<
22504  *
22505  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
22506  */
22507  __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
22508  __pyx_v_to_dtype_func = NULL;
22509  }
22510  __pyx_L3:;
22511 
22512  /* "View.MemoryView":1103
22513  * to_dtype_func = NULL
22514  *
22515  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
22516  * to_object_func, to_dtype_func,
22517  * memview.dtype_is_object)
22518  */
22519  __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
22520  __Pyx_XDECREF(__pyx_r);
22521 
22522  /* "View.MemoryView":1105
22523  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
22524  * to_object_func, to_dtype_func,
22525  * memview.dtype_is_object) # <<<<<<<<<<<<<<
22526  *
22527  *
22528  */
22529  __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
22530  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
22531  __Pyx_GOTREF(__pyx_t_5);
22532  __pyx_r = __pyx_t_5;
22533  __pyx_t_5 = 0;
22534  goto __pyx_L0;
22535 
22536  /* "View.MemoryView":1089
22537  *
22538  * @cname('__pyx_memoryview_copy_object_from_slice')
22539  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
22540  * """
22541  * Create a new memoryview object from a given memoryview object and slice.
22542  */
22543 
22544  /* function exit code */
22545  __pyx_L1_error:;
22546  __Pyx_XDECREF(__pyx_t_5);
22547  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22548  __pyx_r = 0;
22549  __pyx_L0:;
22550  __Pyx_XGIVEREF(__pyx_r);
22551  __Pyx_TraceReturn(__pyx_r, 0);
22552  __Pyx_RefNannyFinishContext();
22553  return __pyx_r;
22554 }
22555 
22556 /* "View.MemoryView":1111
22557  *
22558  *
22559  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
22560  * if arg < 0:
22561  * return -arg
22562  */
22563 
22564 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
22565  Py_ssize_t __pyx_r;
22566  __Pyx_TraceDeclarations
22567  int __pyx_t_1;
22568  int __pyx_lineno = 0;
22569  const char *__pyx_filename = NULL;
22570  int __pyx_clineno = 0;
22571  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
22572 
22573  /* "View.MemoryView":1112
22574  *
22575  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
22576  * if arg < 0: # <<<<<<<<<<<<<<
22577  * return -arg
22578  * else:
22579  */
22580  __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
22581  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
22582  if (__pyx_t_1) {
22583 
22584  /* "View.MemoryView":1113
22585  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
22586  * if arg < 0:
22587  * return -arg # <<<<<<<<<<<<<<
22588  * else:
22589  * return arg
22590  */
22591  __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
22592  __pyx_r = (-__pyx_v_arg);
22593  goto __pyx_L0;
22594 
22595  /* "View.MemoryView":1112
22596  *
22597  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
22598  * if arg < 0: # <<<<<<<<<<<<<<
22599  * return -arg
22600  * else:
22601  */
22602  }
22603 
22604  /* "View.MemoryView":1115
22605  * return -arg
22606  * else:
22607  * return arg # <<<<<<<<<<<<<<
22608  *
22609  * @cname('__pyx_get_best_slice_order')
22610  */
22611  __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
22612  /*else*/ {
22613  __pyx_r = __pyx_v_arg;
22614  goto __pyx_L0;
22615  }
22616 
22617  /* "View.MemoryView":1111
22618  *
22619  *
22620  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
22621  * if arg < 0:
22622  * return -arg
22623  */
22624 
22625  /* function exit code */
22626  __pyx_L1_error:;
22627  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22628  __pyx_r = 0;
22629  __pyx_L0:;
22630  __Pyx_TraceReturn(Py_None, 1);
22631  return __pyx_r;
22632 }
22633 
22634 /* "View.MemoryView":1118
22635  *
22636  * @cname('__pyx_get_best_slice_order')
22637  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
22638  * """
22639  * Figure out the best memory access order for a given slice.
22640  */
22641 
22642 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
22643  int __pyx_v_i;
22644  Py_ssize_t __pyx_v_c_stride;
22645  Py_ssize_t __pyx_v_f_stride;
22646  char __pyx_r;
22647  __Pyx_TraceDeclarations
22648  int __pyx_t_1;
22649  int __pyx_t_2;
22650  int __pyx_t_3;
22651  int __pyx_t_4;
22652  int __pyx_lineno = 0;
22653  const char *__pyx_filename = NULL;
22654  int __pyx_clineno = 0;
22655  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
22656 
22657  /* "View.MemoryView":1123
22658  * """
22659  * cdef int i
22660  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
22661  * cdef Py_ssize_t f_stride = 0
22662  *
22663  */
22664  __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
22665  __pyx_v_c_stride = 0;
22666 
22667  /* "View.MemoryView":1124
22668  * cdef int i
22669  * cdef Py_ssize_t c_stride = 0
22670  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
22671  *
22672  * for i in range(ndim - 1, -1, -1):
22673  */
22674  __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
22675  __pyx_v_f_stride = 0;
22676 
22677  /* "View.MemoryView":1126
22678  * cdef Py_ssize_t f_stride = 0
22679  *
22680  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
22681  * if mslice.shape[i] > 1:
22682  * c_stride = mslice.strides[i]
22683  */
22684  __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
22685  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
22686  __pyx_v_i = __pyx_t_1;
22687 
22688  /* "View.MemoryView":1127
22689  *
22690  * for i in range(ndim - 1, -1, -1):
22691  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
22692  * c_stride = mslice.strides[i]
22693  * break
22694  */
22695  __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
22696  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22697  if (__pyx_t_2) {
22698 
22699  /* "View.MemoryView":1128
22700  * for i in range(ndim - 1, -1, -1):
22701  * if mslice.shape[i] > 1:
22702  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
22703  * break
22704  *
22705  */
22706  __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
22707  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22708 
22709  /* "View.MemoryView":1129
22710  * if mslice.shape[i] > 1:
22711  * c_stride = mslice.strides[i]
22712  * break # <<<<<<<<<<<<<<
22713  *
22714  * for i in range(ndim):
22715  */
22716  __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
22717  goto __pyx_L4_break;
22718 
22719  /* "View.MemoryView":1127
22720  *
22721  * for i in range(ndim - 1, -1, -1):
22722  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
22723  * c_stride = mslice.strides[i]
22724  * break
22725  */
22726  }
22727  }
22728  __pyx_L4_break:;
22729 
22730  /* "View.MemoryView":1131
22731  * break
22732  *
22733  * for i in range(ndim): # <<<<<<<<<<<<<<
22734  * if mslice.shape[i] > 1:
22735  * f_stride = mslice.strides[i]
22736  */
22737  __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
22738  __pyx_t_1 = __pyx_v_ndim;
22739  __pyx_t_3 = __pyx_t_1;
22740  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22741  __pyx_v_i = __pyx_t_4;
22742 
22743  /* "View.MemoryView":1132
22744  *
22745  * for i in range(ndim):
22746  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
22747  * f_stride = mslice.strides[i]
22748  * break
22749  */
22750  __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
22751  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22752  if (__pyx_t_2) {
22753 
22754  /* "View.MemoryView":1133
22755  * for i in range(ndim):
22756  * if mslice.shape[i] > 1:
22757  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
22758  * break
22759  *
22760  */
22761  __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
22762  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22763 
22764  /* "View.MemoryView":1134
22765  * if mslice.shape[i] > 1:
22766  * f_stride = mslice.strides[i]
22767  * break # <<<<<<<<<<<<<<
22768  *
22769  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
22770  */
22771  __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
22772  goto __pyx_L7_break;
22773 
22774  /* "View.MemoryView":1132
22775  *
22776  * for i in range(ndim):
22777  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
22778  * f_stride = mslice.strides[i]
22779  * break
22780  */
22781  }
22782  }
22783  __pyx_L7_break:;
22784 
22785  /* "View.MemoryView":1136
22786  * break
22787  *
22788  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
22789  * return 'C'
22790  * else:
22791  */
22792  __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
22793  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
22794  if (__pyx_t_2) {
22795 
22796  /* "View.MemoryView":1137
22797  *
22798  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
22799  * return 'C' # <<<<<<<<<<<<<<
22800  * else:
22801  * return 'F'
22802  */
22803  __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
22804  __pyx_r = 'C';
22805  goto __pyx_L0;
22806 
22807  /* "View.MemoryView":1136
22808  * break
22809  *
22810  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
22811  * return 'C'
22812  * else:
22813  */
22814  }
22815 
22816  /* "View.MemoryView":1139
22817  * return 'C'
22818  * else:
22819  * return 'F' # <<<<<<<<<<<<<<
22820  *
22821  * @cython.cdivision(True)
22822  */
22823  __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
22824  /*else*/ {
22825  __pyx_r = 'F';
22826  goto __pyx_L0;
22827  }
22828 
22829  /* "View.MemoryView":1118
22830  *
22831  * @cname('__pyx_get_best_slice_order')
22832  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
22833  * """
22834  * Figure out the best memory access order for a given slice.
22835  */
22836 
22837  /* function exit code */
22838  __pyx_L1_error:;
22839  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22840  __pyx_r = 0;
22841  __pyx_L0:;
22842  __Pyx_TraceReturn(Py_None, 1);
22843  return __pyx_r;
22844 }
22845 
22846 /* "View.MemoryView":1142
22847  *
22848  * @cython.cdivision(True)
22849  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
22850  * char *dst_data, Py_ssize_t *dst_strides,
22851  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
22852  */
22853 
22854 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
22855  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
22856  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
22857  Py_ssize_t __pyx_v_dst_extent;
22858  Py_ssize_t __pyx_v_src_stride;
22859  Py_ssize_t __pyx_v_dst_stride;
22860  int __pyx_t_1;
22861  int __pyx_t_2;
22862  int __pyx_t_3;
22863  Py_ssize_t __pyx_t_4;
22864  Py_ssize_t __pyx_t_5;
22865  Py_ssize_t __pyx_t_6;
22866 
22867  /* "View.MemoryView":1149
22868  *
22869  * cdef Py_ssize_t i
22870  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
22871  * cdef Py_ssize_t dst_extent = dst_shape[0]
22872  * cdef Py_ssize_t src_stride = src_strides[0]
22873  */
22874  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
22875 
22876  /* "View.MemoryView":1150
22877  * cdef Py_ssize_t i
22878  * cdef Py_ssize_t src_extent = src_shape[0]
22879  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
22880  * cdef Py_ssize_t src_stride = src_strides[0]
22881  * cdef Py_ssize_t dst_stride = dst_strides[0]
22882  */
22883  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
22884 
22885  /* "View.MemoryView":1151
22886  * cdef Py_ssize_t src_extent = src_shape[0]
22887  * cdef Py_ssize_t dst_extent = dst_shape[0]
22888  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
22889  * cdef Py_ssize_t dst_stride = dst_strides[0]
22890  *
22891  */
22892  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
22893 
22894  /* "View.MemoryView":1152
22895  * cdef Py_ssize_t dst_extent = dst_shape[0]
22896  * cdef Py_ssize_t src_stride = src_strides[0]
22897  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
22898  *
22899  * if ndim == 1:
22900  */
22901  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
22902 
22903  /* "View.MemoryView":1154
22904  * cdef Py_ssize_t dst_stride = dst_strides[0]
22905  *
22906  * if ndim == 1: # <<<<<<<<<<<<<<
22907  * if (src_stride > 0 and dst_stride > 0 and
22908  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22909  */
22910  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
22911  if (__pyx_t_1) {
22912 
22913  /* "View.MemoryView":1155
22914  *
22915  * if ndim == 1:
22916  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
22917  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22918  * memcpy(dst_data, src_data, itemsize * dst_extent)
22919  */
22920  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
22921  if (__pyx_t_2) {
22922  } else {
22923  __pyx_t_1 = __pyx_t_2;
22924  goto __pyx_L5_bool_binop_done;
22925  }
22926  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
22927  if (__pyx_t_2) {
22928  } else {
22929  __pyx_t_1 = __pyx_t_2;
22930  goto __pyx_L5_bool_binop_done;
22931  }
22932 
22933  /* "View.MemoryView":1156
22934  * if ndim == 1:
22935  * if (src_stride > 0 and dst_stride > 0 and
22936  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
22937  * memcpy(dst_data, src_data, itemsize * dst_extent)
22938  * else:
22939  */
22940  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
22941  if (__pyx_t_2) {
22942  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
22943  }
22944  __pyx_t_3 = (__pyx_t_2 != 0);
22945  __pyx_t_1 = __pyx_t_3;
22946  __pyx_L5_bool_binop_done:;
22947 
22948  /* "View.MemoryView":1155
22949  *
22950  * if ndim == 1:
22951  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
22952  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22953  * memcpy(dst_data, src_data, itemsize * dst_extent)
22954  */
22955  if (__pyx_t_1) {
22956 
22957  /* "View.MemoryView":1157
22958  * if (src_stride > 0 and dst_stride > 0 and
22959  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22960  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
22961  * else:
22962  * for i in range(dst_extent):
22963  */
22964  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
22965 
22966  /* "View.MemoryView":1155
22967  *
22968  * if ndim == 1:
22969  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
22970  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22971  * memcpy(dst_data, src_data, itemsize * dst_extent)
22972  */
22973  goto __pyx_L4;
22974  }
22975 
22976  /* "View.MemoryView":1159
22977  * memcpy(dst_data, src_data, itemsize * dst_extent)
22978  * else:
22979  * for i in range(dst_extent): # <<<<<<<<<<<<<<
22980  * memcpy(dst_data, src_data, itemsize)
22981  * src_data += src_stride
22982  */
22983  /*else*/ {
22984  __pyx_t_4 = __pyx_v_dst_extent;
22985  __pyx_t_5 = __pyx_t_4;
22986  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22987  __pyx_v_i = __pyx_t_6;
22988 
22989  /* "View.MemoryView":1160
22990  * else:
22991  * for i in range(dst_extent):
22992  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
22993  * src_data += src_stride
22994  * dst_data += dst_stride
22995  */
22996  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
22997 
22998  /* "View.MemoryView":1161
22999  * for i in range(dst_extent):
23000  * memcpy(dst_data, src_data, itemsize)
23001  * src_data += src_stride # <<<<<<<<<<<<<<
23002  * dst_data += dst_stride
23003  * else:
23004  */
23005  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
23006 
23007  /* "View.MemoryView":1162
23008  * memcpy(dst_data, src_data, itemsize)
23009  * src_data += src_stride
23010  * dst_data += dst_stride # <<<<<<<<<<<<<<
23011  * else:
23012  * for i in range(dst_extent):
23013  */
23014  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
23015  }
23016  }
23017  __pyx_L4:;
23018 
23019  /* "View.MemoryView":1154
23020  * cdef Py_ssize_t dst_stride = dst_strides[0]
23021  *
23022  * if ndim == 1: # <<<<<<<<<<<<<<
23023  * if (src_stride > 0 and dst_stride > 0 and
23024  * <size_t> src_stride == itemsize == <size_t> dst_stride):
23025  */
23026  goto __pyx_L3;
23027  }
23028 
23029  /* "View.MemoryView":1164
23030  * dst_data += dst_stride
23031  * else:
23032  * for i in range(dst_extent): # <<<<<<<<<<<<<<
23033  * _copy_strided_to_strided(src_data, src_strides + 1,
23034  * dst_data, dst_strides + 1,
23035  */
23036  /*else*/ {
23037  __pyx_t_4 = __pyx_v_dst_extent;
23038  __pyx_t_5 = __pyx_t_4;
23039  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23040  __pyx_v_i = __pyx_t_6;
23041 
23042  /* "View.MemoryView":1165
23043  * else:
23044  * for i in range(dst_extent):
23045  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
23046  * dst_data, dst_strides + 1,
23047  * src_shape + 1, dst_shape + 1,
23048  */
23049  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
23050 
23051  /* "View.MemoryView":1169
23052  * src_shape + 1, dst_shape + 1,
23053  * ndim - 1, itemsize)
23054  * src_data += src_stride # <<<<<<<<<<<<<<
23055  * dst_data += dst_stride
23056  *
23057  */
23058  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
23059 
23060  /* "View.MemoryView":1170
23061  * ndim - 1, itemsize)
23062  * src_data += src_stride
23063  * dst_data += dst_stride # <<<<<<<<<<<<<<
23064  *
23065  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
23066  */
23067  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
23068  }
23069  }
23070  __pyx_L3:;
23071 
23072  /* "View.MemoryView":1142
23073  *
23074  * @cython.cdivision(True)
23075  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
23076  * char *dst_data, Py_ssize_t *dst_strides,
23077  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
23078  */
23079 
23080  /* function exit code */
23081 }
23082 
23083 /* "View.MemoryView":1172
23084  * dst_data += dst_stride
23085  *
23086  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23087  * __Pyx_memviewslice *dst,
23088  * int ndim, size_t itemsize) nogil:
23089  */
23090 
23091 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
23092  __Pyx_TraceDeclarations
23093  int __pyx_lineno = 0;
23094  const char *__pyx_filename = NULL;
23095  int __pyx_clineno = 0;
23096  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
23097 
23098  /* "View.MemoryView":1175
23099  * __Pyx_memviewslice *dst,
23100  * int ndim, size_t itemsize) nogil:
23101  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
23102  * src.shape, dst.shape, ndim, itemsize)
23103  *
23104  */
23105  __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
23106  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
23107 
23108  /* "View.MemoryView":1172
23109  * dst_data += dst_stride
23110  *
23111  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23112  * __Pyx_memviewslice *dst,
23113  * int ndim, size_t itemsize) nogil:
23114  */
23115 
23116  /* function exit code */
23117  goto __pyx_L0;
23118  __pyx_L1_error:;
23119  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23120  __pyx_L0:;
23121  __Pyx_TraceReturn(Py_None, 1);
23122 }
23123 
23124 /* "View.MemoryView":1179
23125  *
23126  * @cname('__pyx_memoryview_slice_get_size')
23127  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
23128  * "Return the size of the memory occupied by the slice in number of bytes"
23129  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
23130  */
23131 
23132 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
23133  Py_ssize_t __pyx_v_shape;
23134  Py_ssize_t __pyx_v_size;
23135  Py_ssize_t __pyx_r;
23136  __Pyx_TraceDeclarations
23137  Py_ssize_t __pyx_t_1;
23138  Py_ssize_t *__pyx_t_2;
23139  Py_ssize_t *__pyx_t_3;
23140  Py_ssize_t *__pyx_t_4;
23141  int __pyx_lineno = 0;
23142  const char *__pyx_filename = NULL;
23143  int __pyx_clineno = 0;
23144  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
23145 
23146  /* "View.MemoryView":1181
23147  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
23148  * "Return the size of the memory occupied by the slice in number of bytes"
23149  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
23150  *
23151  * for shape in src.shape[:ndim]:
23152  */
23153  __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
23154  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
23155  __pyx_v_size = __pyx_t_1;
23156 
23157  /* "View.MemoryView":1183
23158  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
23159  *
23160  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
23161  * size *= shape
23162  *
23163  */
23164  __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
23165  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
23166  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
23167  __pyx_t_2 = __pyx_t_4;
23168  __pyx_v_shape = (__pyx_t_2[0]);
23169 
23170  /* "View.MemoryView":1184
23171  *
23172  * for shape in src.shape[:ndim]:
23173  * size *= shape # <<<<<<<<<<<<<<
23174  *
23175  * return size
23176  */
23177  __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
23178  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
23179  }
23180 
23181  /* "View.MemoryView":1186
23182  * size *= shape
23183  *
23184  * return size # <<<<<<<<<<<<<<
23185  *
23186  * @cname('__pyx_fill_contig_strides_array')
23187  */
23188  __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
23189  __pyx_r = __pyx_v_size;
23190  goto __pyx_L0;
23191 
23192  /* "View.MemoryView":1179
23193  *
23194  * @cname('__pyx_memoryview_slice_get_size')
23195  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
23196  * "Return the size of the memory occupied by the slice in number of bytes"
23197  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
23198  */
23199 
23200  /* function exit code */
23201  __pyx_L1_error:;
23202  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23203  __pyx_r = 0;
23204  __pyx_L0:;
23205  __Pyx_TraceReturn(Py_None, 1);
23206  return __pyx_r;
23207 }
23208 
23209 /* "View.MemoryView":1189
23210  *
23211  * @cname('__pyx_fill_contig_strides_array')
23212  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
23213  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
23214  * int ndim, char order) nogil:
23215  */
23216 
23217 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
23218  int __pyx_v_idx;
23219  Py_ssize_t __pyx_r;
23220  __Pyx_TraceDeclarations
23221  int __pyx_t_1;
23222  int __pyx_t_2;
23223  int __pyx_t_3;
23224  int __pyx_t_4;
23225  int __pyx_lineno = 0;
23226  const char *__pyx_filename = NULL;
23227  int __pyx_clineno = 0;
23228  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
23229 
23230  /* "View.MemoryView":1198
23231  * cdef int idx
23232  *
23233  * if order == 'F': # <<<<<<<<<<<<<<
23234  * for idx in range(ndim):
23235  * strides[idx] = stride
23236  */
23237  __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
23238  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
23239  if (__pyx_t_1) {
23240 
23241  /* "View.MemoryView":1199
23242  *
23243  * if order == 'F':
23244  * for idx in range(ndim): # <<<<<<<<<<<<<<
23245  * strides[idx] = stride
23246  * stride *= shape[idx]
23247  */
23248  __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
23249  __pyx_t_2 = __pyx_v_ndim;
23250  __pyx_t_3 = __pyx_t_2;
23251  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23252  __pyx_v_idx = __pyx_t_4;
23253 
23254  /* "View.MemoryView":1200
23255  * if order == 'F':
23256  * for idx in range(ndim):
23257  * strides[idx] = stride # <<<<<<<<<<<<<<
23258  * stride *= shape[idx]
23259  * else:
23260  */
23261  __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
23262  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23263 
23264  /* "View.MemoryView":1201
23265  * for idx in range(ndim):
23266  * strides[idx] = stride
23267  * stride *= shape[idx] # <<<<<<<<<<<<<<
23268  * else:
23269  * for idx in range(ndim - 1, -1, -1):
23270  */
23271  __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
23272  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23273  }
23274 
23275  /* "View.MemoryView":1198
23276  * cdef int idx
23277  *
23278  * if order == 'F': # <<<<<<<<<<<<<<
23279  * for idx in range(ndim):
23280  * strides[idx] = stride
23281  */
23282  goto __pyx_L3;
23283  }
23284 
23285  /* "View.MemoryView":1203
23286  * stride *= shape[idx]
23287  * else:
23288  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
23289  * strides[idx] = stride
23290  * stride *= shape[idx]
23291  */
23292  __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
23293  /*else*/ {
23294  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
23295  __pyx_v_idx = __pyx_t_2;
23296 
23297  /* "View.MemoryView":1204
23298  * else:
23299  * for idx in range(ndim - 1, -1, -1):
23300  * strides[idx] = stride # <<<<<<<<<<<<<<
23301  * stride *= shape[idx]
23302  *
23303  */
23304  __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
23305  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23306 
23307  /* "View.MemoryView":1205
23308  * for idx in range(ndim - 1, -1, -1):
23309  * strides[idx] = stride
23310  * stride *= shape[idx] # <<<<<<<<<<<<<<
23311  *
23312  * return stride
23313  */
23314  __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
23315  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23316  }
23317  }
23318  __pyx_L3:;
23319 
23320  /* "View.MemoryView":1207
23321  * stride *= shape[idx]
23322  *
23323  * return stride # <<<<<<<<<<<<<<
23324  *
23325  * @cname('__pyx_memoryview_copy_data_to_temp')
23326  */
23327  __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
23328  __pyx_r = __pyx_v_stride;
23329  goto __pyx_L0;
23330 
23331  /* "View.MemoryView":1189
23332  *
23333  * @cname('__pyx_fill_contig_strides_array')
23334  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
23335  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
23336  * int ndim, char order) nogil:
23337  */
23338 
23339  /* function exit code */
23340  __pyx_L1_error:;
23341  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23342  __pyx_r = 0;
23343  __pyx_L0:;
23344  __Pyx_TraceReturn(Py_None, 1);
23345  return __pyx_r;
23346 }
23347 
23348 /* "View.MemoryView":1210
23349  *
23350  * @cname('__pyx_memoryview_copy_data_to_temp')
23351  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23352  * __Pyx_memviewslice *tmpslice,
23353  * char order,
23354  */
23355 
23356 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
23357  int __pyx_v_i;
23358  void *__pyx_v_result;
23359  size_t __pyx_v_itemsize;
23360  size_t __pyx_v_size;
23361  void *__pyx_r;
23362  __Pyx_TraceDeclarations
23363  Py_ssize_t __pyx_t_1;
23364  int __pyx_t_2;
23365  int __pyx_t_3;
23366  struct __pyx_memoryview_obj *__pyx_t_4;
23367  int __pyx_t_5;
23368  int __pyx_t_6;
23369  int __pyx_lineno = 0;
23370  const char *__pyx_filename = NULL;
23371  int __pyx_clineno = 0;
23372  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
23373 
23374  /* "View.MemoryView":1221
23375  * cdef void *result
23376  *
23377  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
23378  * cdef size_t size = slice_get_size(src, ndim)
23379  *
23380  */
23381  __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
23382  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
23383  __pyx_v_itemsize = __pyx_t_1;
23384 
23385  /* "View.MemoryView":1222
23386  *
23387  * cdef size_t itemsize = src.memview.view.itemsize
23388  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
23389  *
23390  * result = malloc(size)
23391  */
23392  __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
23393  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
23394 
23395  /* "View.MemoryView":1224
23396  * cdef size_t size = slice_get_size(src, ndim)
23397  *
23398  * result = malloc(size) # <<<<<<<<<<<<<<
23399  * if not result:
23400  * _err(MemoryError, NULL)
23401  */
23402  __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
23403  __pyx_v_result = malloc(__pyx_v_size);
23404 
23405  /* "View.MemoryView":1225
23406  *
23407  * result = malloc(size)
23408  * if not result: # <<<<<<<<<<<<<<
23409  * _err(MemoryError, NULL)
23410  *
23411  */
23412  __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
23413  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
23414  if (__pyx_t_2) {
23415 
23416  /* "View.MemoryView":1226
23417  * result = malloc(size)
23418  * if not result:
23419  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
23420  *
23421  *
23422  */
23423  __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
23424  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
23425 
23426  /* "View.MemoryView":1225
23427  *
23428  * result = malloc(size)
23429  * if not result: # <<<<<<<<<<<<<<
23430  * _err(MemoryError, NULL)
23431  *
23432  */
23433  }
23434 
23435  /* "View.MemoryView":1229
23436  *
23437  *
23438  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
23439  * tmpslice.memview = src.memview
23440  * for i in range(ndim):
23441  */
23442  __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
23443  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
23444 
23445  /* "View.MemoryView":1230
23446  *
23447  * tmpslice.data = <char *> result
23448  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
23449  * for i in range(ndim):
23450  * tmpslice.shape[i] = src.shape[i]
23451  */
23452  __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
23453  __pyx_t_4 = __pyx_v_src->memview;
23454  __pyx_v_tmpslice->memview = __pyx_t_4;
23455 
23456  /* "View.MemoryView":1231
23457  * tmpslice.data = <char *> result
23458  * tmpslice.memview = src.memview
23459  * for i in range(ndim): # <<<<<<<<<<<<<<
23460  * tmpslice.shape[i] = src.shape[i]
23461  * tmpslice.suboffsets[i] = -1
23462  */
23463  __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
23464  __pyx_t_3 = __pyx_v_ndim;
23465  __pyx_t_5 = __pyx_t_3;
23466  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23467  __pyx_v_i = __pyx_t_6;
23468 
23469  /* "View.MemoryView":1232
23470  * tmpslice.memview = src.memview
23471  * for i in range(ndim):
23472  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
23473  * tmpslice.suboffsets[i] = -1
23474  *
23475  */
23476  __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
23477  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
23478 
23479  /* "View.MemoryView":1233
23480  * for i in range(ndim):
23481  * tmpslice.shape[i] = src.shape[i]
23482  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
23483  *
23484  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
23485  */
23486  __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
23487  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
23488  }
23489 
23490  /* "View.MemoryView":1235
23491  * tmpslice.suboffsets[i] = -1
23492  *
23493  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
23494  * ndim, order)
23495  *
23496  */
23497  __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
23498  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
23499 
23500  /* "View.MemoryView":1239
23501  *
23502  *
23503  * for i in range(ndim): # <<<<<<<<<<<<<<
23504  * if tmpslice.shape[i] == 1:
23505  * tmpslice.strides[i] = 0
23506  */
23507  __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
23508  __pyx_t_3 = __pyx_v_ndim;
23509  __pyx_t_5 = __pyx_t_3;
23510  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23511  __pyx_v_i = __pyx_t_6;
23512 
23513  /* "View.MemoryView":1240
23514  *
23515  * for i in range(ndim):
23516  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
23517  * tmpslice.strides[i] = 0
23518  *
23519  */
23520  __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
23521  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
23522  if (__pyx_t_2) {
23523 
23524  /* "View.MemoryView":1241
23525  * for i in range(ndim):
23526  * if tmpslice.shape[i] == 1:
23527  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
23528  *
23529  * if slice_is_contig(src[0], order, ndim):
23530  */
23531  __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
23532  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
23533 
23534  /* "View.MemoryView":1240
23535  *
23536  * for i in range(ndim):
23537  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
23538  * tmpslice.strides[i] = 0
23539  *
23540  */
23541  }
23542  }
23543 
23544  /* "View.MemoryView":1243
23545  * tmpslice.strides[i] = 0
23546  *
23547  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
23548  * memcpy(result, src.data, size)
23549  * else:
23550  */
23551  __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
23552  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
23553  if (__pyx_t_2) {
23554 
23555  /* "View.MemoryView":1244
23556  *
23557  * if slice_is_contig(src[0], order, ndim):
23558  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
23559  * else:
23560  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
23561  */
23562  __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
23563  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
23564 
23565  /* "View.MemoryView":1243
23566  * tmpslice.strides[i] = 0
23567  *
23568  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
23569  * memcpy(result, src.data, size)
23570  * else:
23571  */
23572  goto __pyx_L9;
23573  }
23574 
23575  /* "View.MemoryView":1246
23576  * memcpy(result, src.data, size)
23577  * else:
23578  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
23579  *
23580  * return result
23581  */
23582  __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
23583  /*else*/ {
23584  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
23585  }
23586  __pyx_L9:;
23587 
23588  /* "View.MemoryView":1248
23589  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
23590  *
23591  * return result # <<<<<<<<<<<<<<
23592  *
23593  *
23594  */
23595  __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
23596  __pyx_r = __pyx_v_result;
23597  goto __pyx_L0;
23598 
23599  /* "View.MemoryView":1210
23600  *
23601  * @cname('__pyx_memoryview_copy_data_to_temp')
23602  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23603  * __Pyx_memviewslice *tmpslice,
23604  * char order,
23605  */
23606 
23607  /* function exit code */
23608  __pyx_L1_error:;
23609  {
23610  #ifdef WITH_THREAD
23611  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23612  #endif
23613  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
23614  #ifdef WITH_THREAD
23615  __Pyx_PyGILState_Release(__pyx_gilstate_save);
23616  #endif
23617  }
23618  __pyx_r = NULL;
23619  __pyx_L0:;
23620  __Pyx_TraceReturn(Py_None, 1);
23621  return __pyx_r;
23622 }
23623 
23624 /* "View.MemoryView":1253
23625  *
23626  * @cname('__pyx_memoryview_err_extents')
23627  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
23628  * Py_ssize_t extent2) except -1 with gil:
23629  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23630  */
23631 
23632 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
23633  int __pyx_r;
23634  __Pyx_TraceDeclarations
23635  __Pyx_RefNannyDeclarations
23636  PyObject *__pyx_t_1 = NULL;
23637  PyObject *__pyx_t_2 = NULL;
23638  PyObject *__pyx_t_3 = NULL;
23639  PyObject *__pyx_t_4 = NULL;
23640  int __pyx_lineno = 0;
23641  const char *__pyx_filename = NULL;
23642  int __pyx_clineno = 0;
23643  #ifdef WITH_THREAD
23644  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23645  #endif
23646  __Pyx_RefNannySetupContext("_err_extents", 0);
23647  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
23648 
23649  /* "View.MemoryView":1256
23650  * Py_ssize_t extent2) except -1 with gil:
23651  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23652  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
23653  *
23654  * @cname('__pyx_memoryview_err_dim')
23655  */
23656  __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
23657  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
23658  __Pyx_GOTREF(__pyx_t_1);
23659  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
23660  __Pyx_GOTREF(__pyx_t_2);
23661  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
23662  __Pyx_GOTREF(__pyx_t_3);
23663  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
23664  __Pyx_GOTREF(__pyx_t_4);
23665  __Pyx_GIVEREF(__pyx_t_1);
23666  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
23667  __Pyx_GIVEREF(__pyx_t_2);
23668  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
23669  __Pyx_GIVEREF(__pyx_t_3);
23670  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
23671  __pyx_t_1 = 0;
23672  __pyx_t_2 = 0;
23673  __pyx_t_3 = 0;
23674 
23675  /* "View.MemoryView":1255
23676  * cdef int _err_extents(int i, Py_ssize_t extent1,
23677  * Py_ssize_t extent2) except -1 with gil:
23678  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
23679  * (i, extent1, extent2))
23680  *
23681  */
23682  __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
23683  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
23684  __Pyx_GOTREF(__pyx_t_3);
23685  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23686  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
23687  __Pyx_GOTREF(__pyx_t_4);
23688  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23689  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23690  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23691  __PYX_ERR(1, 1255, __pyx_L1_error)
23692 
23693  /* "View.MemoryView":1253
23694  *
23695  * @cname('__pyx_memoryview_err_extents')
23696  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
23697  * Py_ssize_t extent2) except -1 with gil:
23698  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23699  */
23700 
23701  /* function exit code */
23702  __pyx_L1_error:;
23703  __Pyx_XDECREF(__pyx_t_1);
23704  __Pyx_XDECREF(__pyx_t_2);
23705  __Pyx_XDECREF(__pyx_t_3);
23706  __Pyx_XDECREF(__pyx_t_4);
23707  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
23708  __pyx_r = -1;
23709  __Pyx_TraceReturn(Py_None, 0);
23710  __Pyx_RefNannyFinishContext();
23711  #ifdef WITH_THREAD
23712  __Pyx_PyGILState_Release(__pyx_gilstate_save);
23713  #endif
23714  return __pyx_r;
23715 }
23716 
23717 /* "View.MemoryView":1259
23718  *
23719  * @cname('__pyx_memoryview_err_dim')
23720  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
23721  * raise error(msg.decode('ascii') % dim)
23722  *
23723  */
23724 
23725 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
23726  int __pyx_r;
23727  __Pyx_TraceDeclarations
23728  __Pyx_RefNannyDeclarations
23729  PyObject *__pyx_t_1 = NULL;
23730  PyObject *__pyx_t_2 = NULL;
23731  PyObject *__pyx_t_3 = NULL;
23732  PyObject *__pyx_t_4 = NULL;
23733  int __pyx_lineno = 0;
23734  const char *__pyx_filename = NULL;
23735  int __pyx_clineno = 0;
23736  #ifdef WITH_THREAD
23737  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23738  #endif
23739  __Pyx_RefNannySetupContext("_err_dim", 0);
23740  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
23741  __Pyx_INCREF(__pyx_v_error);
23742 
23743  /* "View.MemoryView":1260
23744  * @cname('__pyx_memoryview_err_dim')
23745  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
23746  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
23747  *
23748  * @cname('__pyx_memoryview_err')
23749  */
23750  __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
23751  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
23752  __Pyx_GOTREF(__pyx_t_2);
23753  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
23754  __Pyx_GOTREF(__pyx_t_3);
23755  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
23756  __Pyx_GOTREF(__pyx_t_4);
23757  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23758  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23759  __Pyx_INCREF(__pyx_v_error);
23760  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
23761  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
23762  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
23763  if (likely(__pyx_t_2)) {
23764  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
23765  __Pyx_INCREF(__pyx_t_2);
23766  __Pyx_INCREF(function);
23767  __Pyx_DECREF_SET(__pyx_t_3, function);
23768  }
23769  }
23770  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
23771  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23772  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23773  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
23774  __Pyx_GOTREF(__pyx_t_1);
23775  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23776  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23777  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23778  __PYX_ERR(1, 1260, __pyx_L1_error)
23779 
23780  /* "View.MemoryView":1259
23781  *
23782  * @cname('__pyx_memoryview_err_dim')
23783  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
23784  * raise error(msg.decode('ascii') % dim)
23785  *
23786  */
23787 
23788  /* function exit code */
23789  __pyx_L1_error:;
23790  __Pyx_XDECREF(__pyx_t_1);
23791  __Pyx_XDECREF(__pyx_t_2);
23792  __Pyx_XDECREF(__pyx_t_3);
23793  __Pyx_XDECREF(__pyx_t_4);
23794  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
23795  __pyx_r = -1;
23796  __Pyx_XDECREF(__pyx_v_error);
23797  __Pyx_TraceReturn(Py_None, 0);
23798  __Pyx_RefNannyFinishContext();
23799  #ifdef WITH_THREAD
23800  __Pyx_PyGILState_Release(__pyx_gilstate_save);
23801  #endif
23802  return __pyx_r;
23803 }
23804 
23805 /* "View.MemoryView":1263
23806  *
23807  * @cname('__pyx_memoryview_err')
23808  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
23809  * if msg != NULL:
23810  * raise error(msg.decode('ascii'))
23811  */
23812 
23813 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
23814  int __pyx_r;
23815  __Pyx_TraceDeclarations
23816  __Pyx_RefNannyDeclarations
23817  int __pyx_t_1;
23818  PyObject *__pyx_t_2 = NULL;
23819  PyObject *__pyx_t_3 = NULL;
23820  PyObject *__pyx_t_4 = NULL;
23821  PyObject *__pyx_t_5 = NULL;
23822  int __pyx_lineno = 0;
23823  const char *__pyx_filename = NULL;
23824  int __pyx_clineno = 0;
23825  #ifdef WITH_THREAD
23826  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23827  #endif
23828  __Pyx_RefNannySetupContext("_err", 0);
23829  __Pyx_TraceCall("_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
23830  __Pyx_INCREF(__pyx_v_error);
23831 
23832  /* "View.MemoryView":1264
23833  * @cname('__pyx_memoryview_err')
23834  * cdef int _err(object error, char *msg) except -1 with gil:
23835  * if msg != NULL: # <<<<<<<<<<<<<<
23836  * raise error(msg.decode('ascii'))
23837  * else:
23838  */
23839  __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
23840  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
23841  if (unlikely(__pyx_t_1)) {
23842 
23843  /* "View.MemoryView":1265
23844  * cdef int _err(object error, char *msg) except -1 with gil:
23845  * if msg != NULL:
23846  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
23847  * else:
23848  * raise error
23849  */
23850  __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
23851  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
23852  __Pyx_GOTREF(__pyx_t_3);
23853  __Pyx_INCREF(__pyx_v_error);
23854  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
23855  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
23856  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
23857  if (likely(__pyx_t_5)) {
23858  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
23859  __Pyx_INCREF(__pyx_t_5);
23860  __Pyx_INCREF(function);
23861  __Pyx_DECREF_SET(__pyx_t_4, function);
23862  }
23863  }
23864  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
23865  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23866  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23867  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
23868  __Pyx_GOTREF(__pyx_t_2);
23869  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23870  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
23871  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23872  __PYX_ERR(1, 1265, __pyx_L1_error)
23873 
23874  /* "View.MemoryView":1264
23875  * @cname('__pyx_memoryview_err')
23876  * cdef int _err(object error, char *msg) except -1 with gil:
23877  * if msg != NULL: # <<<<<<<<<<<<<<
23878  * raise error(msg.decode('ascii'))
23879  * else:
23880  */
23881  }
23882 
23883  /* "View.MemoryView":1267
23884  * raise error(msg.decode('ascii'))
23885  * else:
23886  * raise error # <<<<<<<<<<<<<<
23887  *
23888  * @cname('__pyx_memoryview_copy_contents')
23889  */
23890  __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
23891  /*else*/ {
23892  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
23893  __PYX_ERR(1, 1267, __pyx_L1_error)
23894  }
23895 
23896  /* "View.MemoryView":1263
23897  *
23898  * @cname('__pyx_memoryview_err')
23899  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
23900  * if msg != NULL:
23901  * raise error(msg.decode('ascii'))
23902  */
23903 
23904  /* function exit code */
23905  __pyx_L1_error:;
23906  __Pyx_XDECREF(__pyx_t_2);
23907  __Pyx_XDECREF(__pyx_t_3);
23908  __Pyx_XDECREF(__pyx_t_4);
23909  __Pyx_XDECREF(__pyx_t_5);
23910  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
23911  __pyx_r = -1;
23912  __Pyx_XDECREF(__pyx_v_error);
23913  __Pyx_TraceReturn(Py_None, 0);
23914  __Pyx_RefNannyFinishContext();
23915  #ifdef WITH_THREAD
23916  __Pyx_PyGILState_Release(__pyx_gilstate_save);
23917  #endif
23918  return __pyx_r;
23919 }
23920 
23921 /* "View.MemoryView":1270
23922  *
23923  * @cname('__pyx_memoryview_copy_contents')
23924  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
23925  * __Pyx_memviewslice dst,
23926  * int src_ndim, int dst_ndim,
23927  */
23928 
23929 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
23930  void *__pyx_v_tmpdata;
23931  size_t __pyx_v_itemsize;
23932  int __pyx_v_i;
23933  char __pyx_v_order;
23934  int __pyx_v_broadcasting;
23935  int __pyx_v_direct_copy;
23936  __Pyx_memviewslice __pyx_v_tmp;
23937  int __pyx_v_ndim;
23938  int __pyx_r;
23939  __Pyx_TraceDeclarations
23940  Py_ssize_t __pyx_t_1;
23941  int __pyx_t_2;
23942  int __pyx_t_3;
23943  int __pyx_t_4;
23944  int __pyx_t_5;
23945  int __pyx_t_6;
23946  void *__pyx_t_7;
23947  int __pyx_t_8;
23948  int __pyx_lineno = 0;
23949  const char *__pyx_filename = NULL;
23950  int __pyx_clineno = 0;
23951  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
23952 
23953  /* "View.MemoryView":1278
23954  * Check for overlapping memory and verify the shapes.
23955  * """
23956  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
23957  * cdef size_t itemsize = src.memview.view.itemsize
23958  * cdef int i
23959  */
23960  __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
23961  __pyx_v_tmpdata = NULL;
23962 
23963  /* "View.MemoryView":1279
23964  * """
23965  * cdef void *tmpdata = NULL
23966  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
23967  * cdef int i
23968  * cdef char order = get_best_order(&src, src_ndim)
23969  */
23970  __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
23971  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
23972  __pyx_v_itemsize = __pyx_t_1;
23973 
23974  /* "View.MemoryView":1281
23975  * cdef size_t itemsize = src.memview.view.itemsize
23976  * cdef int i
23977  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
23978  * cdef bint broadcasting = False
23979  * cdef bint direct_copy = False
23980  */
23981  __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
23982  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
23983 
23984  /* "View.MemoryView":1282
23985  * cdef int i
23986  * cdef char order = get_best_order(&src, src_ndim)
23987  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
23988  * cdef bint direct_copy = False
23989  * cdef __Pyx_memviewslice tmp
23990  */
23991  __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
23992  __pyx_v_broadcasting = 0;
23993 
23994  /* "View.MemoryView":1283
23995  * cdef char order = get_best_order(&src, src_ndim)
23996  * cdef bint broadcasting = False
23997  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
23998  * cdef __Pyx_memviewslice tmp
23999  *
24000  */
24001  __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
24002  __pyx_v_direct_copy = 0;
24003 
24004  /* "View.MemoryView":1286
24005  * cdef __Pyx_memviewslice tmp
24006  *
24007  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
24008  * broadcast_leading(&src, src_ndim, dst_ndim)
24009  * elif dst_ndim < src_ndim:
24010  */
24011  __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
24012  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
24013  if (__pyx_t_2) {
24014 
24015  /* "View.MemoryView":1287
24016  *
24017  * if src_ndim < dst_ndim:
24018  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
24019  * elif dst_ndim < src_ndim:
24020  * broadcast_leading(&dst, dst_ndim, src_ndim)
24021  */
24022  __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
24023  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
24024 
24025  /* "View.MemoryView":1286
24026  * cdef __Pyx_memviewslice tmp
24027  *
24028  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
24029  * broadcast_leading(&src, src_ndim, dst_ndim)
24030  * elif dst_ndim < src_ndim:
24031  */
24032  goto __pyx_L3;
24033  }
24034 
24035  /* "View.MemoryView":1288
24036  * if src_ndim < dst_ndim:
24037  * broadcast_leading(&src, src_ndim, dst_ndim)
24038  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
24039  * broadcast_leading(&dst, dst_ndim, src_ndim)
24040  *
24041  */
24042  __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
24043  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
24044  if (__pyx_t_2) {
24045 
24046  /* "View.MemoryView":1289
24047  * broadcast_leading(&src, src_ndim, dst_ndim)
24048  * elif dst_ndim < src_ndim:
24049  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
24050  *
24051  * cdef int ndim = max(src_ndim, dst_ndim)
24052  */
24053  __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
24054  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
24055 
24056  /* "View.MemoryView":1288
24057  * if src_ndim < dst_ndim:
24058  * broadcast_leading(&src, src_ndim, dst_ndim)
24059  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
24060  * broadcast_leading(&dst, dst_ndim, src_ndim)
24061  *
24062  */
24063  }
24064  __pyx_L3:;
24065 
24066  /* "View.MemoryView":1291
24067  * broadcast_leading(&dst, dst_ndim, src_ndim)
24068  *
24069  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
24070  *
24071  * for i in range(ndim):
24072  */
24073  __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
24074  __pyx_t_3 = __pyx_v_dst_ndim;
24075  __pyx_t_4 = __pyx_v_src_ndim;
24076  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
24077  __pyx_t_5 = __pyx_t_3;
24078  } else {
24079  __pyx_t_5 = __pyx_t_4;
24080  }
24081  __pyx_v_ndim = __pyx_t_5;
24082 
24083  /* "View.MemoryView":1293
24084  * cdef int ndim = max(src_ndim, dst_ndim)
24085  *
24086  * for i in range(ndim): # <<<<<<<<<<<<<<
24087  * if src.shape[i] != dst.shape[i]:
24088  * if src.shape[i] == 1:
24089  */
24090  __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
24091  __pyx_t_5 = __pyx_v_ndim;
24092  __pyx_t_3 = __pyx_t_5;
24093  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24094  __pyx_v_i = __pyx_t_4;
24095 
24096  /* "View.MemoryView":1294
24097  *
24098  * for i in range(ndim):
24099  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
24100  * if src.shape[i] == 1:
24101  * broadcasting = True
24102  */
24103  __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
24104  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
24105  if (__pyx_t_2) {
24106 
24107  /* "View.MemoryView":1295
24108  * for i in range(ndim):
24109  * if src.shape[i] != dst.shape[i]:
24110  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
24111  * broadcasting = True
24112  * src.strides[i] = 0
24113  */
24114  __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
24115  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
24116  if (__pyx_t_2) {
24117 
24118  /* "View.MemoryView":1296
24119  * if src.shape[i] != dst.shape[i]:
24120  * if src.shape[i] == 1:
24121  * broadcasting = True # <<<<<<<<<<<<<<
24122  * src.strides[i] = 0
24123  * else:
24124  */
24125  __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
24126  __pyx_v_broadcasting = 1;
24127 
24128  /* "View.MemoryView":1297
24129  * if src.shape[i] == 1:
24130  * broadcasting = True
24131  * src.strides[i] = 0 # <<<<<<<<<<<<<<
24132  * else:
24133  * _err_extents(i, dst.shape[i], src.shape[i])
24134  */
24135  __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
24136  (__pyx_v_src.strides[__pyx_v_i]) = 0;
24137 
24138  /* "View.MemoryView":1295
24139  * for i in range(ndim):
24140  * if src.shape[i] != dst.shape[i]:
24141  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
24142  * broadcasting = True
24143  * src.strides[i] = 0
24144  */
24145  goto __pyx_L7;
24146  }
24147 
24148  /* "View.MemoryView":1299
24149  * src.strides[i] = 0
24150  * else:
24151  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
24152  *
24153  * if src.suboffsets[i] >= 0:
24154  */
24155  __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
24156  /*else*/ {
24157  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
24158  }
24159  __pyx_L7:;
24160 
24161  /* "View.MemoryView":1294
24162  *
24163  * for i in range(ndim):
24164  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
24165  * if src.shape[i] == 1:
24166  * broadcasting = True
24167  */
24168  }
24169 
24170  /* "View.MemoryView":1301
24171  * _err_extents(i, dst.shape[i], src.shape[i])
24172  *
24173  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
24174  * _err_dim(ValueError, "Dimension %d is not direct", i)
24175  *
24176  */
24177  __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
24178  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
24179  if (__pyx_t_2) {
24180 
24181  /* "View.MemoryView":1302
24182  *
24183  * if src.suboffsets[i] >= 0:
24184  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
24185  *
24186  * if slices_overlap(&src, &dst, ndim, itemsize):
24187  */
24188  __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
24189  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
24190 
24191  /* "View.MemoryView":1301
24192  * _err_extents(i, dst.shape[i], src.shape[i])
24193  *
24194  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
24195  * _err_dim(ValueError, "Dimension %d is not direct", i)
24196  *
24197  */
24198  }
24199  }
24200 
24201  /* "View.MemoryView":1304
24202  * _err_dim(ValueError, "Dimension %d is not direct", i)
24203  *
24204  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
24205  *
24206  * if not slice_is_contig(src, order, ndim):
24207  */
24208  __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
24209  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
24210  if (__pyx_t_2) {
24211 
24212  /* "View.MemoryView":1306
24213  * if slices_overlap(&src, &dst, ndim, itemsize):
24214  *
24215  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
24216  * order = get_best_order(&dst, ndim)
24217  *
24218  */
24219  __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
24220  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
24221  if (__pyx_t_2) {
24222 
24223  /* "View.MemoryView":1307
24224  *
24225  * if not slice_is_contig(src, order, ndim):
24226  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
24227  *
24228  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
24229  */
24230  __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
24231  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
24232 
24233  /* "View.MemoryView":1306
24234  * if slices_overlap(&src, &dst, ndim, itemsize):
24235  *
24236  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
24237  * order = get_best_order(&dst, ndim)
24238  *
24239  */
24240  }
24241 
24242  /* "View.MemoryView":1309
24243  * order = get_best_order(&dst, ndim)
24244  *
24245  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
24246  * src = tmp
24247  *
24248  */
24249  __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
24250  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
24251  __pyx_v_tmpdata = __pyx_t_7;
24252 
24253  /* "View.MemoryView":1310
24254  *
24255  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
24256  * src = tmp # <<<<<<<<<<<<<<
24257  *
24258  * if not broadcasting:
24259  */
24260  __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
24261  __pyx_v_src = __pyx_v_tmp;
24262 
24263  /* "View.MemoryView":1304
24264  * _err_dim(ValueError, "Dimension %d is not direct", i)
24265  *
24266  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
24267  *
24268  * if not slice_is_contig(src, order, ndim):
24269  */
24270  }
24271 
24272  /* "View.MemoryView":1312
24273  * src = tmp
24274  *
24275  * if not broadcasting: # <<<<<<<<<<<<<<
24276  *
24277  *
24278  */
24279  __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
24280  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
24281  if (__pyx_t_2) {
24282 
24283  /* "View.MemoryView":1315
24284  *
24285  *
24286  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
24287  * direct_copy = slice_is_contig(dst, 'C', ndim)
24288  * elif slice_is_contig(src, 'F', ndim):
24289  */
24290  __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
24291  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
24292  if (__pyx_t_2) {
24293 
24294  /* "View.MemoryView":1316
24295  *
24296  * if slice_is_contig(src, 'C', ndim):
24297  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
24298  * elif slice_is_contig(src, 'F', ndim):
24299  * direct_copy = slice_is_contig(dst, 'F', ndim)
24300  */
24301  __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
24302  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
24303 
24304  /* "View.MemoryView":1315
24305  *
24306  *
24307  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
24308  * direct_copy = slice_is_contig(dst, 'C', ndim)
24309  * elif slice_is_contig(src, 'F', ndim):
24310  */
24311  goto __pyx_L12;
24312  }
24313 
24314  /* "View.MemoryView":1317
24315  * if slice_is_contig(src, 'C', ndim):
24316  * direct_copy = slice_is_contig(dst, 'C', ndim)
24317  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
24318  * direct_copy = slice_is_contig(dst, 'F', ndim)
24319  *
24320  */
24321  __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
24322  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
24323  if (__pyx_t_2) {
24324 
24325  /* "View.MemoryView":1318
24326  * direct_copy = slice_is_contig(dst, 'C', ndim)
24327  * elif slice_is_contig(src, 'F', ndim):
24328  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
24329  *
24330  * if direct_copy:
24331  */
24332  __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
24333  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
24334 
24335  /* "View.MemoryView":1317
24336  * if slice_is_contig(src, 'C', ndim):
24337  * direct_copy = slice_is_contig(dst, 'C', ndim)
24338  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
24339  * direct_copy = slice_is_contig(dst, 'F', ndim)
24340  *
24341  */
24342  }
24343  __pyx_L12:;
24344 
24345  /* "View.MemoryView":1320
24346  * direct_copy = slice_is_contig(dst, 'F', ndim)
24347  *
24348  * if direct_copy: # <<<<<<<<<<<<<<
24349  *
24350  * refcount_copying(&dst, dtype_is_object, ndim, False)
24351  */
24352  __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
24353  __pyx_t_2 = (__pyx_v_direct_copy != 0);
24354  if (__pyx_t_2) {
24355 
24356  /* "View.MemoryView":1322
24357  * if direct_copy:
24358  *
24359  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
24360  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
24361  * refcount_copying(&dst, dtype_is_object, ndim, True)
24362  */
24363  __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
24364  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24365 
24366  /* "View.MemoryView":1323
24367  *
24368  * refcount_copying(&dst, dtype_is_object, ndim, False)
24369  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
24370  * refcount_copying(&dst, dtype_is_object, ndim, True)
24371  * free(tmpdata)
24372  */
24373  __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
24374  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
24375 
24376  /* "View.MemoryView":1324
24377  * refcount_copying(&dst, dtype_is_object, ndim, False)
24378  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
24379  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
24380  * free(tmpdata)
24381  * return 0
24382  */
24383  __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
24384  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24385 
24386  /* "View.MemoryView":1325
24387  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
24388  * refcount_copying(&dst, dtype_is_object, ndim, True)
24389  * free(tmpdata) # <<<<<<<<<<<<<<
24390  * return 0
24391  *
24392  */
24393  __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
24394  free(__pyx_v_tmpdata);
24395 
24396  /* "View.MemoryView":1326
24397  * refcount_copying(&dst, dtype_is_object, ndim, True)
24398  * free(tmpdata)
24399  * return 0 # <<<<<<<<<<<<<<
24400  *
24401  * if order == 'F' == get_best_order(&dst, ndim):
24402  */
24403  __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
24404  __pyx_r = 0;
24405  goto __pyx_L0;
24406 
24407  /* "View.MemoryView":1320
24408  * direct_copy = slice_is_contig(dst, 'F', ndim)
24409  *
24410  * if direct_copy: # <<<<<<<<<<<<<<
24411  *
24412  * refcount_copying(&dst, dtype_is_object, ndim, False)
24413  */
24414  }
24415 
24416  /* "View.MemoryView":1312
24417  * src = tmp
24418  *
24419  * if not broadcasting: # <<<<<<<<<<<<<<
24420  *
24421  *
24422  */
24423  }
24424 
24425  /* "View.MemoryView":1328
24426  * return 0
24427  *
24428  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
24429  *
24430  *
24431  */
24432  __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
24433  __pyx_t_2 = (__pyx_v_order == 'F');
24434  if (__pyx_t_2) {
24435  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
24436  }
24437  __pyx_t_8 = (__pyx_t_2 != 0);
24438  if (__pyx_t_8) {
24439 
24440  /* "View.MemoryView":1331
24441  *
24442  *
24443  * transpose_memslice(&src) # <<<<<<<<<<<<<<
24444  * transpose_memslice(&dst)
24445  *
24446  */
24447  __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
24448  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
24449 
24450  /* "View.MemoryView":1332
24451  *
24452  * transpose_memslice(&src)
24453  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
24454  *
24455  * refcount_copying(&dst, dtype_is_object, ndim, False)
24456  */
24457  __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
24458  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
24459 
24460  /* "View.MemoryView":1328
24461  * return 0
24462  *
24463  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
24464  *
24465  *
24466  */
24467  }
24468 
24469  /* "View.MemoryView":1334
24470  * transpose_memslice(&dst)
24471  *
24472  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
24473  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
24474  * refcount_copying(&dst, dtype_is_object, ndim, True)
24475  */
24476  __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
24477  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24478 
24479  /* "View.MemoryView":1335
24480  *
24481  * refcount_copying(&dst, dtype_is_object, ndim, False)
24482  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
24483  * refcount_copying(&dst, dtype_is_object, ndim, True)
24484  *
24485  */
24486  __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
24487  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
24488 
24489  /* "View.MemoryView":1336
24490  * refcount_copying(&dst, dtype_is_object, ndim, False)
24491  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
24492  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
24493  *
24494  * free(tmpdata)
24495  */
24496  __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
24497  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24498 
24499  /* "View.MemoryView":1338
24500  * refcount_copying(&dst, dtype_is_object, ndim, True)
24501  *
24502  * free(tmpdata) # <<<<<<<<<<<<<<
24503  * return 0
24504  *
24505  */
24506  __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
24507  free(__pyx_v_tmpdata);
24508 
24509  /* "View.MemoryView":1339
24510  *
24511  * free(tmpdata)
24512  * return 0 # <<<<<<<<<<<<<<
24513  *
24514  * @cname('__pyx_memoryview_broadcast_leading')
24515  */
24516  __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
24517  __pyx_r = 0;
24518  goto __pyx_L0;
24519 
24520  /* "View.MemoryView":1270
24521  *
24522  * @cname('__pyx_memoryview_copy_contents')
24523  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
24524  * __Pyx_memviewslice dst,
24525  * int src_ndim, int dst_ndim,
24526  */
24527 
24528  /* function exit code */
24529  __pyx_L1_error:;
24530  {
24531  #ifdef WITH_THREAD
24532  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24533  #endif
24534  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
24535  #ifdef WITH_THREAD
24536  __Pyx_PyGILState_Release(__pyx_gilstate_save);
24537  #endif
24538  }
24539  __pyx_r = -1;
24540  __pyx_L0:;
24541  __Pyx_TraceReturn(Py_None, 1);
24542  return __pyx_r;
24543 }
24544 
24545 /* "View.MemoryView":1342
24546  *
24547  * @cname('__pyx_memoryview_broadcast_leading')
24548  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
24549  * int ndim,
24550  * int ndim_other) nogil:
24551  */
24552 
24553 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
24554  int __pyx_v_i;
24555  int __pyx_v_offset;
24556  __Pyx_TraceDeclarations
24557  int __pyx_t_1;
24558  int __pyx_t_2;
24559  int __pyx_t_3;
24560  int __pyx_lineno = 0;
24561  const char *__pyx_filename = NULL;
24562  int __pyx_clineno = 0;
24563  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
24564 
24565  /* "View.MemoryView":1346
24566  * int ndim_other) nogil:
24567  * cdef int i
24568  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
24569  *
24570  * for i in range(ndim - 1, -1, -1):
24571  */
24572  __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
24573  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
24574 
24575  /* "View.MemoryView":1348
24576  * cdef int offset = ndim_other - ndim
24577  *
24578  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
24579  * mslice.shape[i + offset] = mslice.shape[i]
24580  * mslice.strides[i + offset] = mslice.strides[i]
24581  */
24582  __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
24583  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
24584  __pyx_v_i = __pyx_t_1;
24585 
24586  /* "View.MemoryView":1349
24587  *
24588  * for i in range(ndim - 1, -1, -1):
24589  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
24590  * mslice.strides[i + offset] = mslice.strides[i]
24591  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
24592  */
24593  __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
24594  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
24595 
24596  /* "View.MemoryView":1350
24597  * for i in range(ndim - 1, -1, -1):
24598  * mslice.shape[i + offset] = mslice.shape[i]
24599  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
24600  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
24601  *
24602  */
24603  __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
24604  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
24605 
24606  /* "View.MemoryView":1351
24607  * mslice.shape[i + offset] = mslice.shape[i]
24608  * mslice.strides[i + offset] = mslice.strides[i]
24609  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
24610  *
24611  * for i in range(offset):
24612  */
24613  __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
24614  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
24615  }
24616 
24617  /* "View.MemoryView":1353
24618  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
24619  *
24620  * for i in range(offset): # <<<<<<<<<<<<<<
24621  * mslice.shape[i] = 1
24622  * mslice.strides[i] = mslice.strides[0]
24623  */
24624  __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
24625  __pyx_t_1 = __pyx_v_offset;
24626  __pyx_t_2 = __pyx_t_1;
24627  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24628  __pyx_v_i = __pyx_t_3;
24629 
24630  /* "View.MemoryView":1354
24631  *
24632  * for i in range(offset):
24633  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
24634  * mslice.strides[i] = mslice.strides[0]
24635  * mslice.suboffsets[i] = -1
24636  */
24637  __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
24638  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
24639 
24640  /* "View.MemoryView":1355
24641  * for i in range(offset):
24642  * mslice.shape[i] = 1
24643  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
24644  * mslice.suboffsets[i] = -1
24645  *
24646  */
24647  __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
24648  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
24649 
24650  /* "View.MemoryView":1356
24651  * mslice.shape[i] = 1
24652  * mslice.strides[i] = mslice.strides[0]
24653  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
24654  *
24655  *
24656  */
24657  __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
24658  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
24659  }
24660 
24661  /* "View.MemoryView":1342
24662  *
24663  * @cname('__pyx_memoryview_broadcast_leading')
24664  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
24665  * int ndim,
24666  * int ndim_other) nogil:
24667  */
24668 
24669  /* function exit code */
24670  goto __pyx_L0;
24671  __pyx_L1_error:;
24672  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24673  __pyx_L0:;
24674  __Pyx_TraceReturn(Py_None, 1);
24675 }
24676 
24677 /* "View.MemoryView":1364
24678  *
24679  * @cname('__pyx_memoryview_refcount_copying')
24680  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
24681  * int ndim, bint inc) nogil:
24682  *
24683  */
24684 
24685 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
24686  __Pyx_TraceDeclarations
24687  int __pyx_t_1;
24688  int __pyx_lineno = 0;
24689  const char *__pyx_filename = NULL;
24690  int __pyx_clineno = 0;
24691  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
24692 
24693  /* "View.MemoryView":1368
24694  *
24695  *
24696  * if dtype_is_object: # <<<<<<<<<<<<<<
24697  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
24698  * dst.strides, ndim, inc)
24699  */
24700  __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
24701  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
24702  if (__pyx_t_1) {
24703 
24704  /* "View.MemoryView":1369
24705  *
24706  * if dtype_is_object:
24707  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
24708  * dst.strides, ndim, inc)
24709  *
24710  */
24711  __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
24712  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
24713 
24714  /* "View.MemoryView":1368
24715  *
24716  *
24717  * if dtype_is_object: # <<<<<<<<<<<<<<
24718  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
24719  * dst.strides, ndim, inc)
24720  */
24721  }
24722 
24723  /* "View.MemoryView":1364
24724  *
24725  * @cname('__pyx_memoryview_refcount_copying')
24726  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
24727  * int ndim, bint inc) nogil:
24728  *
24729  */
24730 
24731  /* function exit code */
24732  goto __pyx_L0;
24733  __pyx_L1_error:;
24734  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24735  __pyx_L0:;
24736  __Pyx_TraceReturn(Py_None, 1);
24737 }
24738 
24739 /* "View.MemoryView":1373
24740  *
24741  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
24742  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24743  * Py_ssize_t *strides, int ndim,
24744  * bint inc) with gil:
24745  */
24746 
24747 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
24748  __Pyx_TraceDeclarations
24749  __Pyx_RefNannyDeclarations
24750  int __pyx_lineno = 0;
24751  const char *__pyx_filename = NULL;
24752  int __pyx_clineno = 0;
24753  #ifdef WITH_THREAD
24754  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24755  #endif
24756  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
24757  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
24758 
24759  /* "View.MemoryView":1376
24760  * Py_ssize_t *strides, int ndim,
24761  * bint inc) with gil:
24762  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
24763  *
24764  * @cname('__pyx_memoryview_refcount_objects_in_slice')
24765  */
24766  __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
24767  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
24768 
24769  /* "View.MemoryView":1373
24770  *
24771  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
24772  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24773  * Py_ssize_t *strides, int ndim,
24774  * bint inc) with gil:
24775  */
24776 
24777  /* function exit code */
24778  goto __pyx_L0;
24779  __pyx_L1_error:;
24780  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
24781  __pyx_L0:;
24782  __Pyx_TraceReturn(Py_None, 0);
24783  __Pyx_RefNannyFinishContext();
24784  #ifdef WITH_THREAD
24785  __Pyx_PyGILState_Release(__pyx_gilstate_save);
24786  #endif
24787 }
24788 
24789 /* "View.MemoryView":1379
24790  *
24791  * @cname('__pyx_memoryview_refcount_objects_in_slice')
24792  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24793  * Py_ssize_t *strides, int ndim, bint inc):
24794  * cdef Py_ssize_t i
24795  */
24796 
24797 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
24798  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
24799  __Pyx_TraceDeclarations
24800  __Pyx_RefNannyDeclarations
24801  Py_ssize_t __pyx_t_1;
24802  Py_ssize_t __pyx_t_2;
24803  Py_ssize_t __pyx_t_3;
24804  int __pyx_t_4;
24805  int __pyx_lineno = 0;
24806  const char *__pyx_filename = NULL;
24807  int __pyx_clineno = 0;
24808  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
24809  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
24810 
24811  /* "View.MemoryView":1383
24812  * cdef Py_ssize_t i
24813  *
24814  * for i in range(shape[0]): # <<<<<<<<<<<<<<
24815  * if ndim == 1:
24816  * if inc:
24817  */
24818  __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
24819  __pyx_t_1 = (__pyx_v_shape[0]);
24820  __pyx_t_2 = __pyx_t_1;
24821  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24822  __pyx_v_i = __pyx_t_3;
24823 
24824  /* "View.MemoryView":1384
24825  *
24826  * for i in range(shape[0]):
24827  * if ndim == 1: # <<<<<<<<<<<<<<
24828  * if inc:
24829  * Py_INCREF((<PyObject **> data)[0])
24830  */
24831  __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
24832  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
24833  if (__pyx_t_4) {
24834 
24835  /* "View.MemoryView":1385
24836  * for i in range(shape[0]):
24837  * if ndim == 1:
24838  * if inc: # <<<<<<<<<<<<<<
24839  * Py_INCREF((<PyObject **> data)[0])
24840  * else:
24841  */
24842  __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
24843  __pyx_t_4 = (__pyx_v_inc != 0);
24844  if (__pyx_t_4) {
24845 
24846  /* "View.MemoryView":1386
24847  * if ndim == 1:
24848  * if inc:
24849  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
24850  * else:
24851  * Py_DECREF((<PyObject **> data)[0])
24852  */
24853  __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
24854  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
24855 
24856  /* "View.MemoryView":1385
24857  * for i in range(shape[0]):
24858  * if ndim == 1:
24859  * if inc: # <<<<<<<<<<<<<<
24860  * Py_INCREF((<PyObject **> data)[0])
24861  * else:
24862  */
24863  goto __pyx_L6;
24864  }
24865 
24866  /* "View.MemoryView":1388
24867  * Py_INCREF((<PyObject **> data)[0])
24868  * else:
24869  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
24870  * else:
24871  * refcount_objects_in_slice(data, shape + 1, strides + 1,
24872  */
24873  __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
24874  /*else*/ {
24875  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
24876  }
24877  __pyx_L6:;
24878 
24879  /* "View.MemoryView":1384
24880  *
24881  * for i in range(shape[0]):
24882  * if ndim == 1: # <<<<<<<<<<<<<<
24883  * if inc:
24884  * Py_INCREF((<PyObject **> data)[0])
24885  */
24886  goto __pyx_L5;
24887  }
24888 
24889  /* "View.MemoryView":1390
24890  * Py_DECREF((<PyObject **> data)[0])
24891  * else:
24892  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
24893  * ndim - 1, inc)
24894  *
24895  */
24896  __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
24897  /*else*/ {
24898 
24899  /* "View.MemoryView":1391
24900  * else:
24901  * refcount_objects_in_slice(data, shape + 1, strides + 1,
24902  * ndim - 1, inc) # <<<<<<<<<<<<<<
24903  *
24904  * data += strides[0]
24905  */
24906  __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
24907  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
24908  }
24909  __pyx_L5:;
24910 
24911  /* "View.MemoryView":1393
24912  * ndim - 1, inc)
24913  *
24914  * data += strides[0] # <<<<<<<<<<<<<<
24915  *
24916  *
24917  */
24918  __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
24919  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
24920  }
24921 
24922  /* "View.MemoryView":1379
24923  *
24924  * @cname('__pyx_memoryview_refcount_objects_in_slice')
24925  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24926  * Py_ssize_t *strides, int ndim, bint inc):
24927  * cdef Py_ssize_t i
24928  */
24929 
24930  /* function exit code */
24931  goto __pyx_L0;
24932  __pyx_L1_error:;
24933  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
24934  __pyx_L0:;
24935  __Pyx_TraceReturn(Py_None, 0);
24936  __Pyx_RefNannyFinishContext();
24937 }
24938 
24939 /* "View.MemoryView":1399
24940  *
24941  * @cname('__pyx_memoryview_slice_assign_scalar')
24942  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
24943  * size_t itemsize, void *item,
24944  * bint dtype_is_object) nogil:
24945  */
24946 
24947 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
24948  __Pyx_TraceDeclarations
24949  int __pyx_lineno = 0;
24950  const char *__pyx_filename = NULL;
24951  int __pyx_clineno = 0;
24952  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
24953 
24954  /* "View.MemoryView":1402
24955  * size_t itemsize, void *item,
24956  * bint dtype_is_object) nogil:
24957  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
24958  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
24959  * itemsize, item)
24960  */
24961  __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
24962  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24963 
24964  /* "View.MemoryView":1403
24965  * bint dtype_is_object) nogil:
24966  * refcount_copying(dst, dtype_is_object, ndim, False)
24967  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
24968  * itemsize, item)
24969  * refcount_copying(dst, dtype_is_object, ndim, True)
24970  */
24971  __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
24972  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
24973 
24974  /* "View.MemoryView":1405
24975  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
24976  * itemsize, item)
24977  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
24978  *
24979  *
24980  */
24981  __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
24982  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24983 
24984  /* "View.MemoryView":1399
24985  *
24986  * @cname('__pyx_memoryview_slice_assign_scalar')
24987  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
24988  * size_t itemsize, void *item,
24989  * bint dtype_is_object) nogil:
24990  */
24991 
24992  /* function exit code */
24993  goto __pyx_L0;
24994  __pyx_L1_error:;
24995  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24996  __pyx_L0:;
24997  __Pyx_TraceReturn(Py_None, 1);
24998 }
24999 
25000 /* "View.MemoryView":1409
25001  *
25002  * @cname('__pyx_memoryview__slice_assign_scalar')
25003  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
25004  * Py_ssize_t *strides, int ndim,
25005  * size_t itemsize, void *item) nogil:
25006  */
25007 
25008 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
25009  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
25010  Py_ssize_t __pyx_v_stride;
25011  Py_ssize_t __pyx_v_extent;
25012  __Pyx_TraceDeclarations
25013  int __pyx_t_1;
25014  Py_ssize_t __pyx_t_2;
25015  Py_ssize_t __pyx_t_3;
25016  Py_ssize_t __pyx_t_4;
25017  int __pyx_lineno = 0;
25018  const char *__pyx_filename = NULL;
25019  int __pyx_clineno = 0;
25020  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
25021 
25022  /* "View.MemoryView":1413
25023  * size_t itemsize, void *item) nogil:
25024  * cdef Py_ssize_t i
25025  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
25026  * cdef Py_ssize_t extent = shape[0]
25027  *
25028  */
25029  __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
25030  __pyx_v_stride = (__pyx_v_strides[0]);
25031 
25032  /* "View.MemoryView":1414
25033  * cdef Py_ssize_t i
25034  * cdef Py_ssize_t stride = strides[0]
25035  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
25036  *
25037  * if ndim == 1:
25038  */
25039  __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
25040  __pyx_v_extent = (__pyx_v_shape[0]);
25041 
25042  /* "View.MemoryView":1416
25043  * cdef Py_ssize_t extent = shape[0]
25044  *
25045  * if ndim == 1: # <<<<<<<<<<<<<<
25046  * for i in range(extent):
25047  * memcpy(data, item, itemsize)
25048  */
25049  __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
25050  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
25051  if (__pyx_t_1) {
25052 
25053  /* "View.MemoryView":1417
25054  *
25055  * if ndim == 1:
25056  * for i in range(extent): # <<<<<<<<<<<<<<
25057  * memcpy(data, item, itemsize)
25058  * data += stride
25059  */
25060  __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
25061  __pyx_t_2 = __pyx_v_extent;
25062  __pyx_t_3 = __pyx_t_2;
25063  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
25064  __pyx_v_i = __pyx_t_4;
25065 
25066  /* "View.MemoryView":1418
25067  * if ndim == 1:
25068  * for i in range(extent):
25069  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
25070  * data += stride
25071  * else:
25072  */
25073  __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
25074  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
25075 
25076  /* "View.MemoryView":1419
25077  * for i in range(extent):
25078  * memcpy(data, item, itemsize)
25079  * data += stride # <<<<<<<<<<<<<<
25080  * else:
25081  * for i in range(extent):
25082  */
25083  __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
25084  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
25085  }
25086 
25087  /* "View.MemoryView":1416
25088  * cdef Py_ssize_t extent = shape[0]
25089  *
25090  * if ndim == 1: # <<<<<<<<<<<<<<
25091  * for i in range(extent):
25092  * memcpy(data, item, itemsize)
25093  */
25094  goto __pyx_L3;
25095  }
25096 
25097  /* "View.MemoryView":1421
25098  * data += stride
25099  * else:
25100  * for i in range(extent): # <<<<<<<<<<<<<<
25101  * _slice_assign_scalar(data, shape + 1, strides + 1,
25102  * ndim - 1, itemsize, item)
25103  */
25104  __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
25105  /*else*/ {
25106  __pyx_t_2 = __pyx_v_extent;
25107  __pyx_t_3 = __pyx_t_2;
25108  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
25109  __pyx_v_i = __pyx_t_4;
25110 
25111  /* "View.MemoryView":1422
25112  * else:
25113  * for i in range(extent):
25114  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
25115  * ndim - 1, itemsize, item)
25116  * data += stride
25117  */
25118  __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
25119  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
25120 
25121  /* "View.MemoryView":1424
25122  * _slice_assign_scalar(data, shape + 1, strides + 1,
25123  * ndim - 1, itemsize, item)
25124  * data += stride # <<<<<<<<<<<<<<
25125  *
25126  *
25127  */
25128  __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
25129  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
25130  }
25131  }
25132  __pyx_L3:;
25133 
25134  /* "View.MemoryView":1409
25135  *
25136  * @cname('__pyx_memoryview__slice_assign_scalar')
25137  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
25138  * Py_ssize_t *strides, int ndim,
25139  * size_t itemsize, void *item) nogil:
25140  */
25141 
25142  /* function exit code */
25143  goto __pyx_L0;
25144  __pyx_L1_error:;
25145  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
25146  __pyx_L0:;
25147  __Pyx_TraceReturn(Py_None, 1);
25148 }
25149 
25150 /* "(tree fragment)":1
25151  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
25152  * cdef object __pyx_PickleError
25153  * cdef object __pyx_result
25154  */
25155 
25156 /* Python wrapper */
25157 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25158 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
25159 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25160  PyObject *__pyx_v___pyx_type = 0;
25161  long __pyx_v___pyx_checksum;
25162  PyObject *__pyx_v___pyx_state = 0;
25163  int __pyx_lineno = 0;
25164  const char *__pyx_filename = NULL;
25165  int __pyx_clineno = 0;
25166  PyObject *__pyx_r = 0;
25167  __Pyx_RefNannyDeclarations
25168  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
25169  {
25170  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
25171  PyObject* values[3] = {0,0,0};
25172  if (unlikely(__pyx_kwds)) {
25173  Py_ssize_t kw_args;
25174  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25175  switch (pos_args) {
25176  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
25177  CYTHON_FALLTHROUGH;
25178  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25179  CYTHON_FALLTHROUGH;
25180  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25181  CYTHON_FALLTHROUGH;
25182  case 0: break;
25183  default: goto __pyx_L5_argtuple_error;
25184  }
25185  kw_args = PyDict_Size(__pyx_kwds);
25186  switch (pos_args) {
25187  case 0:
25188  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
25189  else goto __pyx_L5_argtuple_error;
25190  CYTHON_FALLTHROUGH;
25191  case 1:
25192  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
25193  else {
25194  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
25195  }
25196  CYTHON_FALLTHROUGH;
25197  case 2:
25198  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
25199  else {
25200  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
25201  }
25202  }
25203  if (unlikely(kw_args > 0)) {
25204  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
25205  }
25206  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
25207  goto __pyx_L5_argtuple_error;
25208  } else {
25209  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25210  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25211  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
25212  }
25213  __pyx_v___pyx_type = values[0];
25214  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
25215  __pyx_v___pyx_state = values[2];
25216  }
25217  goto __pyx_L4_argument_unpacking_done;
25218  __pyx_L5_argtuple_error:;
25219  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
25220  __pyx_L3_error:;
25221  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
25222  __Pyx_RefNannyFinishContext();
25223  return NULL;
25224  __pyx_L4_argument_unpacking_done:;
25225  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
25226 
25227  /* function exit code */
25228  __Pyx_RefNannyFinishContext();
25229  return __pyx_r;
25230 }
25231 
25232 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
25233  PyObject *__pyx_v___pyx_PickleError = 0;
25234  PyObject *__pyx_v___pyx_result = 0;
25235  PyObject *__pyx_r = NULL;
25236  __Pyx_TraceDeclarations
25237  __Pyx_RefNannyDeclarations
25238  PyObject *__pyx_t_1 = NULL;
25239  int __pyx_t_2;
25240  int __pyx_t_3;
25241  PyObject *__pyx_t_4 = NULL;
25242  PyObject *__pyx_t_5 = NULL;
25243  PyObject *__pyx_t_6 = NULL;
25244  int __pyx_lineno = 0;
25245  const char *__pyx_filename = NULL;
25246  int __pyx_clineno = 0;
25247  __Pyx_TraceFrameInit(__pyx_codeobj__40)
25248  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
25249  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
25250 
25251  /* "(tree fragment)":4
25252  * cdef object __pyx_PickleError
25253  * cdef object __pyx_result
25254  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
25255  * from pickle import PickleError as __pyx_PickleError
25256  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
25257  */
25258  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
25259  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
25260  __Pyx_GOTREF(__pyx_t_1);
25261  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__41, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
25262  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25263  __pyx_t_3 = (__pyx_t_2 != 0);
25264  if (__pyx_t_3) {
25265 
25266  /* "(tree fragment)":5
25267  * cdef object __pyx_result
25268  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
25269  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
25270  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
25271  * __pyx_result = Enum.__new__(__pyx_type)
25272  */
25273  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
25274  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
25275  __Pyx_GOTREF(__pyx_t_1);
25276  __Pyx_INCREF(__pyx_n_s_PickleError);
25277  __Pyx_GIVEREF(__pyx_n_s_PickleError);
25278  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
25279  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
25280  __Pyx_GOTREF(__pyx_t_4);
25281  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25282  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
25283  __Pyx_GOTREF(__pyx_t_1);
25284  __Pyx_INCREF(__pyx_t_1);
25285  __pyx_v___pyx_PickleError = __pyx_t_1;
25286  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25287  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25288 
25289  /* "(tree fragment)":6
25290  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
25291  * from pickle import PickleError as __pyx_PickleError
25292  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
25293  * __pyx_result = Enum.__new__(__pyx_type)
25294  * if __pyx_state is not None:
25295  */
25296  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
25297  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
25298  __Pyx_GOTREF(__pyx_t_1);
25299  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
25300  __Pyx_GOTREF(__pyx_t_5);
25301  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25302  __Pyx_INCREF(__pyx_v___pyx_PickleError);
25303  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
25304  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
25305  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
25306  if (likely(__pyx_t_6)) {
25307  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
25308  __Pyx_INCREF(__pyx_t_6);
25309  __Pyx_INCREF(function);
25310  __Pyx_DECREF_SET(__pyx_t_1, function);
25311  }
25312  }
25313  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
25314  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
25315  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25316  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
25317  __Pyx_GOTREF(__pyx_t_4);
25318  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25319  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
25320  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25321  __PYX_ERR(1, 6, __pyx_L1_error)
25322 
25323  /* "(tree fragment)":4
25324  * cdef object __pyx_PickleError
25325  * cdef object __pyx_result
25326  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
25327  * from pickle import PickleError as __pyx_PickleError
25328  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
25329  */
25330  }
25331 
25332  /* "(tree fragment)":7
25333  * from pickle import PickleError as __pyx_PickleError
25334  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
25335  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
25336  * if __pyx_state is not None:
25337  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25338  */
25339  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
25340  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
25341  __Pyx_GOTREF(__pyx_t_1);
25342  __pyx_t_5 = NULL;
25343  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
25344  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
25345  if (likely(__pyx_t_5)) {
25346  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
25347  __Pyx_INCREF(__pyx_t_5);
25348  __Pyx_INCREF(function);
25349  __Pyx_DECREF_SET(__pyx_t_1, function);
25350  }
25351  }
25352  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
25353  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25354  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
25355  __Pyx_GOTREF(__pyx_t_4);
25356  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25357  __pyx_v___pyx_result = __pyx_t_4;
25358  __pyx_t_4 = 0;
25359 
25360  /* "(tree fragment)":8
25361  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
25362  * __pyx_result = Enum.__new__(__pyx_type)
25363  * if __pyx_state is not None: # <<<<<<<<<<<<<<
25364  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25365  * return __pyx_result
25366  */
25367  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
25368  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
25369  __pyx_t_2 = (__pyx_t_3 != 0);
25370  if (__pyx_t_2) {
25371 
25372  /* "(tree fragment)":9
25373  * __pyx_result = Enum.__new__(__pyx_type)
25374  * if __pyx_state is not None:
25375  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
25376  * return __pyx_result
25377  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25378  */
25379  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
25380  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
25381  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
25382  __Pyx_GOTREF(__pyx_t_4);
25383  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25384 
25385  /* "(tree fragment)":8
25386  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
25387  * __pyx_result = Enum.__new__(__pyx_type)
25388  * if __pyx_state is not None: # <<<<<<<<<<<<<<
25389  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25390  * return __pyx_result
25391  */
25392  }
25393 
25394  /* "(tree fragment)":10
25395  * if __pyx_state is not None:
25396  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25397  * return __pyx_result # <<<<<<<<<<<<<<
25398  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25399  * __pyx_result.name = __pyx_state[0]
25400  */
25401  __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
25402  __Pyx_XDECREF(__pyx_r);
25403  __Pyx_INCREF(__pyx_v___pyx_result);
25404  __pyx_r = __pyx_v___pyx_result;
25405  goto __pyx_L0;
25406 
25407  /* "(tree fragment)":1
25408  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
25409  * cdef object __pyx_PickleError
25410  * cdef object __pyx_result
25411  */
25412 
25413  /* function exit code */
25414  __pyx_L1_error:;
25415  __Pyx_XDECREF(__pyx_t_1);
25416  __Pyx_XDECREF(__pyx_t_4);
25417  __Pyx_XDECREF(__pyx_t_5);
25418  __Pyx_XDECREF(__pyx_t_6);
25419  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
25420  __pyx_r = NULL;
25421  __pyx_L0:;
25422  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
25423  __Pyx_XDECREF(__pyx_v___pyx_result);
25424  __Pyx_XGIVEREF(__pyx_r);
25425  __Pyx_TraceReturn(__pyx_r, 0);
25426  __Pyx_RefNannyFinishContext();
25427  return __pyx_r;
25428 }
25429 
25430 /* "(tree fragment)":11
25431  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25432  * return __pyx_result
25433  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
25434  * __pyx_result.name = __pyx_state[0]
25435  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25436  */
25437 
25438 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
25439  PyObject *__pyx_r = NULL;
25440  __Pyx_TraceDeclarations
25441  __Pyx_RefNannyDeclarations
25442  PyObject *__pyx_t_1 = NULL;
25443  int __pyx_t_2;
25444  Py_ssize_t __pyx_t_3;
25445  int __pyx_t_4;
25446  int __pyx_t_5;
25447  PyObject *__pyx_t_6 = NULL;
25448  PyObject *__pyx_t_7 = NULL;
25449  PyObject *__pyx_t_8 = NULL;
25450  int __pyx_lineno = 0;
25451  const char *__pyx_filename = NULL;
25452  int __pyx_clineno = 0;
25453  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
25454  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
25455 
25456  /* "(tree fragment)":12
25457  * return __pyx_result
25458  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25459  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
25460  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25461  * __pyx_result.__dict__.update(__pyx_state[1])
25462  */
25463  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
25464  if (unlikely(__pyx_v___pyx_state == Py_None)) {
25465  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25466  __PYX_ERR(1, 12, __pyx_L1_error)
25467  }
25468  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
25469  __Pyx_GOTREF(__pyx_t_1);
25470  __Pyx_GIVEREF(__pyx_t_1);
25471  __Pyx_GOTREF(__pyx_v___pyx_result->name);
25472  __Pyx_DECREF(__pyx_v___pyx_result->name);
25473  __pyx_v___pyx_result->name = __pyx_t_1;
25474  __pyx_t_1 = 0;
25475 
25476  /* "(tree fragment)":13
25477  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25478  * __pyx_result.name = __pyx_state[0]
25479  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
25480  * __pyx_result.__dict__.update(__pyx_state[1])
25481  */
25482  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
25483  if (unlikely(__pyx_v___pyx_state == Py_None)) {
25484  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
25485  __PYX_ERR(1, 13, __pyx_L1_error)
25486  }
25487  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
25488  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
25489  if (__pyx_t_4) {
25490  } else {
25491  __pyx_t_2 = __pyx_t_4;
25492  goto __pyx_L4_bool_binop_done;
25493  }
25494  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
25495  __pyx_t_5 = (__pyx_t_4 != 0);
25496  __pyx_t_2 = __pyx_t_5;
25497  __pyx_L4_bool_binop_done:;
25498  if (__pyx_t_2) {
25499 
25500  /* "(tree fragment)":14
25501  * __pyx_result.name = __pyx_state[0]
25502  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25503  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
25504  */
25505  __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
25506  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
25507  __Pyx_GOTREF(__pyx_t_6);
25508  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
25509  __Pyx_GOTREF(__pyx_t_7);
25510  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25511  if (unlikely(__pyx_v___pyx_state == Py_None)) {
25512  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25513  __PYX_ERR(1, 14, __pyx_L1_error)
25514  }
25515  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
25516  __Pyx_GOTREF(__pyx_t_6);
25517  __pyx_t_8 = NULL;
25518  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
25519  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
25520  if (likely(__pyx_t_8)) {
25521  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
25522  __Pyx_INCREF(__pyx_t_8);
25523  __Pyx_INCREF(function);
25524  __Pyx_DECREF_SET(__pyx_t_7, function);
25525  }
25526  }
25527  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
25528  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
25529  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25530  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
25531  __Pyx_GOTREF(__pyx_t_1);
25532  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25533  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25534 
25535  /* "(tree fragment)":13
25536  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25537  * __pyx_result.name = __pyx_state[0]
25538  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
25539  * __pyx_result.__dict__.update(__pyx_state[1])
25540  */
25541  }
25542 
25543  /* "(tree fragment)":11
25544  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25545  * return __pyx_result
25546  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
25547  * __pyx_result.name = __pyx_state[0]
25548  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25549  */
25550 
25551  /* function exit code */
25552  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25553  goto __pyx_L0;
25554  __pyx_L1_error:;
25555  __Pyx_XDECREF(__pyx_t_1);
25556  __Pyx_XDECREF(__pyx_t_6);
25557  __Pyx_XDECREF(__pyx_t_7);
25558  __Pyx_XDECREF(__pyx_t_8);
25559  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
25560  __pyx_r = 0;
25561  __pyx_L0:;
25562  __Pyx_XGIVEREF(__pyx_r);
25563  __Pyx_TraceReturn(__pyx_r, 0);
25564  __Pyx_RefNannyFinishContext();
25565  return __pyx_r;
25566 }
25567 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction __pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
25568 
25569 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyTypeObject *t, PyObject *a, PyObject *k) {
25570  struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p;
25571  PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
25572  if (unlikely(!o)) return 0;
25573  p = ((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o);
25574  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
25575  p->A_csr = Py_None; Py_INCREF(Py_None);
25576  p->B_csr = Py_None; Py_INCREF(Py_None);
25577  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
25578  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25579  p->B_indices_copy = Py_None; Py_INCREF(Py_None);
25580  p->B_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25581  if (unlikely(__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(o, a, k) < 0)) goto bad;
25582  return o;
25583  bad:
25584  Py_DECREF(o); o = 0;
25585  return NULL;
25586 }
25587 
25588 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o) {
25589  struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25590  #if CYTHON_USE_TP_FINALIZE
25591  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25592  if (PyObject_CallFinalizerFromDealloc(o)) return;
25593  }
25594  #endif
25595  PyObject_GC_UnTrack(o);
25596  Py_CLEAR(p->A_csr);
25597  Py_CLEAR(p->B_csr);
25598  Py_CLEAR(p->A_indices_copy);
25599  Py_CLEAR(p->A_index_pointer_copy);
25600  Py_CLEAR(p->B_indices_copy);
25601  Py_CLEAR(p->B_index_pointer_copy);
25602  PyObject_GC_Track(o);
25603  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
25604 }
25605 
25606 static int __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o, visitproc v, void *a) {
25607  int e;
25608  struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25609  e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction)); if (e) return e;
25610  if (p->A_csr) {
25611  e = (*v)(p->A_csr, a); if (e) return e;
25612  }
25613  if (p->B_csr) {
25614  e = (*v)(p->B_csr, a); if (e) return e;
25615  }
25616  if (p->A_indices_copy) {
25617  e = (*v)(p->A_indices_copy, a); if (e) return e;
25618  }
25619  if (p->A_index_pointer_copy) {
25620  e = (*v)(p->A_index_pointer_copy, a); if (e) return e;
25621  }
25622  if (p->B_indices_copy) {
25623  e = (*v)(p->B_indices_copy, a); if (e) return e;
25624  }
25625  if (p->B_index_pointer_copy) {
25626  e = (*v)(p->B_index_pointer_copy, a); if (e) return e;
25627  }
25628  return 0;
25629 }
25630 
25631 static int __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o) {
25632  PyObject* tmp;
25633  struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25634  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) { if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
25635  tmp = ((PyObject*)p->A_csr);
25636  p->A_csr = Py_None; Py_INCREF(Py_None);
25637  Py_XDECREF(tmp);
25638  tmp = ((PyObject*)p->B_csr);
25639  p->B_csr = Py_None; Py_INCREF(Py_None);
25640  Py_XDECREF(tmp);
25641  tmp = ((PyObject*)p->A_indices_copy);
25642  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
25643  Py_XDECREF(tmp);
25644  tmp = ((PyObject*)p->A_index_pointer_copy);
25645  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25646  Py_XDECREF(tmp);
25647  tmp = ((PyObject*)p->B_indices_copy);
25648  p->B_indices_copy = Py_None; Py_INCREF(Py_None);
25649  Py_XDECREF(tmp);
25650  tmp = ((PyObject*)p->B_index_pointer_copy);
25651  p->B_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25652  Py_XDECREF(tmp);
25653  return 0;
25654 }
25655 
25656 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction[] = {
25657  {"set_dense_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float},
25658  {"set_dense_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double},
25659  {"set_dense_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double},
25660  {"set_csr_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float},
25661  {"set_csr_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double},
25662  {"set_csr_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double},
25663  {"set_csc_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float},
25664  {"set_csc_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double},
25665  {"set_csc_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double},
25666  {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__},
25667  {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__},
25668  {0, 0, 0, 0}
25669 };
25670 
25671 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = {
25672  PyVarObject_HEAD_INIT(0, 0)
25673  "imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction", /*tp_name*/
25674  sizeof(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction), /*tp_basicsize*/
25675  0, /*tp_itemsize*/
25676  __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_dealloc*/
25677  #if PY_VERSION_HEX < 0x030800b4
25678  0, /*tp_print*/
25679  #endif
25680  #if PY_VERSION_HEX >= 0x030800b4
25681  0, /*tp_vectorcall_offset*/
25682  #endif
25683  0, /*tp_getattr*/
25684  0, /*tp_setattr*/
25685  #if PY_MAJOR_VERSION < 3
25686  0, /*tp_compare*/
25687  #endif
25688  #if PY_MAJOR_VERSION >= 3
25689  0, /*tp_as_async*/
25690  #endif
25691  0, /*tp_repr*/
25692  0, /*tp_as_number*/
25693  0, /*tp_as_sequence*/
25694  0, /*tp_as_mapping*/
25695  0, /*tp_hash*/
25696  0, /*tp_call*/
25697  0, /*tp_str*/
25698  0, /*tp_getattro*/
25699  0, /*tp_setattro*/
25700  0, /*tp_as_buffer*/
25701  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25702  "\n Defines a linear operator that is an affine function of a single parameter.\n Given two matrices :math:`\\mathbf{A}` and :math:`\\mathf{B}`, the linear\n operator is defined by\n\n .. math::\n\n \\mathbf{A}(t) = \\mathbf{A} + t \\mathbf{B},\n\n where :math:`t \\in \\mathbb{R}` is a parameter.\n\n **Initializing Object:**\n\n The matrices :math:`\\mathbf{A}` and :math:`\\mathbf{B}` are given at the\n initialization of the object. These matrices can be a dense matrix as 2D\n numpy arrays, or sparse matrices of any format (CSR, CSC, etc) using scipy\n sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrices of CSR format. Note the format of the input matrices\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n >>> B = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport AffineMatrixFunction\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, B)\n\n\n The following is an example of defining the operator with dense matrices:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = numpy.random.randn((n, m), dtype=float)\n >>> B = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator ""cimport AffineMatrixFunction\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, B)\n\n If the matrix ``B`` is not given, or if it is ``None``, or if it is ``0``,\n then the linear operator assumes ``B`` is zero matrix. For example:\n\n .. code-block:: python\n\n # Case 1: Not providing B\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A)\n\n # Case 2: Setting B to None\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, None)\n\n # Case 3: Setting B to scalar zero\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, 0)\n\n If the matrix ``B`` is set to the scalar ``1``, the linear operator assumes\n that ``B`` is the identity matrix. For example:\n\n .. code-block:: python\n\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, 1)\n\n **Setting the Parameter:**\n\n The parameter :math:`t` is given to the object ``Aop`` at **runtime** using\n :func:`set_parameters` function.\n\n .. note::\n\n Setting the parameter using :func:`set_parameter` does not require\n python's GIL, hence, the parameter can be set in ``nogil`` environment,\n if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> cdef double t = 1.0\n\n >>> # nogil environment is optional\n >>> with nogil:\n ... Aop.set_parameters(&t)\n\n Note that a *pointer* to the parameter should be provided to the function.\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do not require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n""\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`Matrix`\n ", /*tp_doc*/
25703  __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_traverse*/
25704  __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_clear*/
25705  0, /*tp_richcompare*/
25706  0, /*tp_weaklistoffset*/
25707  0, /*tp_iter*/
25708  0, /*tp_iternext*/
25709  __pyx_methods_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_methods*/
25710  0, /*tp_members*/
25711  0, /*tp_getset*/
25712  0, /*tp_base*/
25713  0, /*tp_dict*/
25714  0, /*tp_descr_get*/
25715  0, /*tp_descr_set*/
25716  0, /*tp_dictoffset*/
25717  0, /*tp_init*/
25718  0, /*tp_alloc*/
25719  __pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_new*/
25720  0, /*tp_free*/
25721  0, /*tp_is_gc*/
25722  0, /*tp_bases*/
25723  0, /*tp_mro*/
25724  0, /*tp_cache*/
25725  0, /*tp_subclasses*/
25726  0, /*tp_weaklist*/
25727  0, /*tp_del*/
25728  0, /*tp_version_tag*/
25729  #if PY_VERSION_HEX >= 0x030400a1
25730  0, /*tp_finalize*/
25731  #endif
25732  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25733  0, /*tp_vectorcall*/
25734  #endif
25735  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25736  0, /*tp_print*/
25737  #endif
25738  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25739  0, /*tp_pypy_flags*/
25740  #endif
25741 };
25742 static struct __pyx_vtabstruct_array __pyx_vtable_array;
25743 
25744 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25745  struct __pyx_array_obj *p;
25746  PyObject *o;
25747  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25748  o = (*t->tp_alloc)(t, 0);
25749  } else {
25750  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25751  }
25752  if (unlikely(!o)) return 0;
25753  p = ((struct __pyx_array_obj *)o);
25754  p->__pyx_vtab = __pyx_vtabptr_array;
25755  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25756  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25757  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
25758  return o;
25759  bad:
25760  Py_DECREF(o); o = 0;
25761  return NULL;
25762 }
25763 
25764 static void __pyx_tp_dealloc_array(PyObject *o) {
25765  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
25766  #if CYTHON_USE_TP_FINALIZE
25767  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25768  if (PyObject_CallFinalizerFromDealloc(o)) return;
25769  }
25770  #endif
25771  {
25772  PyObject *etype, *eval, *etb;
25773  PyErr_Fetch(&etype, &eval, &etb);
25774  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25775  __pyx_array___dealloc__(o);
25776  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25777  PyErr_Restore(etype, eval, etb);
25778  }
25779  Py_CLEAR(p->mode);
25780  Py_CLEAR(p->_format);
25781  (*Py_TYPE(o)->tp_free)(o);
25782 }
25783 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25784  PyObject *r;
25785  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25786  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25787  Py_DECREF(x);
25788  return r;
25789 }
25790 
25791 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25792  if (v) {
25793  return __pyx_array___setitem__(o, i, v);
25794  }
25795  else {
25796  PyErr_Format(PyExc_NotImplementedError,
25797  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
25798  return -1;
25799  }
25800 }
25801 
25802 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25803  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
25804  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25805  PyErr_Clear();
25806  v = __pyx_array___getattr__(o, n);
25807  }
25808  return v;
25809 }
25810 
25811 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
25812  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25813 }
25814 
25815 static PyMethodDef __pyx_methods_array[] = {
25816  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25817  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
25818  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
25819  {0, 0, 0, 0}
25820 };
25821 
25822 static struct PyGetSetDef __pyx_getsets_array[] = {
25823  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
25824  {0, 0, 0, 0, 0}
25825 };
25826 
25827 static PySequenceMethods __pyx_tp_as_sequence_array = {
25828  __pyx_array___len__, /*sq_length*/
25829  0, /*sq_concat*/
25830  0, /*sq_repeat*/
25831  __pyx_sq_item_array, /*sq_item*/
25832  0, /*sq_slice*/
25833  0, /*sq_ass_item*/
25834  0, /*sq_ass_slice*/
25835  0, /*sq_contains*/
25836  0, /*sq_inplace_concat*/
25837  0, /*sq_inplace_repeat*/
25838 };
25839 
25840 static PyMappingMethods __pyx_tp_as_mapping_array = {
25841  __pyx_array___len__, /*mp_length*/
25842  __pyx_array___getitem__, /*mp_subscript*/
25843  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
25844 };
25845 
25846 static PyBufferProcs __pyx_tp_as_buffer_array = {
25847  #if PY_MAJOR_VERSION < 3
25848  0, /*bf_getreadbuffer*/
25849  #endif
25850  #if PY_MAJOR_VERSION < 3
25851  0, /*bf_getwritebuffer*/
25852  #endif
25853  #if PY_MAJOR_VERSION < 3
25854  0, /*bf_getsegcount*/
25855  #endif
25856  #if PY_MAJOR_VERSION < 3
25857  0, /*bf_getcharbuffer*/
25858  #endif
25859  __pyx_array_getbuffer, /*bf_getbuffer*/
25860  0, /*bf_releasebuffer*/
25861 };
25862 
25863 static PyTypeObject __pyx_type___pyx_array = {
25864  PyVarObject_HEAD_INIT(0, 0)
25865  "imate._c_linear_operator.py_c_affine_matrix_function.array", /*tp_name*/
25866  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
25867  0, /*tp_itemsize*/
25868  __pyx_tp_dealloc_array, /*tp_dealloc*/
25869  #if PY_VERSION_HEX < 0x030800b4
25870  0, /*tp_print*/
25871  #endif
25872  #if PY_VERSION_HEX >= 0x030800b4
25873  0, /*tp_vectorcall_offset*/
25874  #endif
25875  0, /*tp_getattr*/
25876  0, /*tp_setattr*/
25877  #if PY_MAJOR_VERSION < 3
25878  0, /*tp_compare*/
25879  #endif
25880  #if PY_MAJOR_VERSION >= 3
25881  0, /*tp_as_async*/
25882  #endif
25883  0, /*tp_repr*/
25884  0, /*tp_as_number*/
25885  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
25886  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
25887  0, /*tp_hash*/
25888  0, /*tp_call*/
25889  0, /*tp_str*/
25890  __pyx_tp_getattro_array, /*tp_getattro*/
25891  0, /*tp_setattro*/
25892  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
25893  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
25894  0, /*tp_doc*/
25895  0, /*tp_traverse*/
25896  0, /*tp_clear*/
25897  0, /*tp_richcompare*/
25898  0, /*tp_weaklistoffset*/
25899  0, /*tp_iter*/
25900  0, /*tp_iternext*/
25901  __pyx_methods_array, /*tp_methods*/
25902  0, /*tp_members*/
25903  __pyx_getsets_array, /*tp_getset*/
25904  0, /*tp_base*/
25905  0, /*tp_dict*/
25906  0, /*tp_descr_get*/
25907  0, /*tp_descr_set*/
25908  0, /*tp_dictoffset*/
25909  0, /*tp_init*/
25910  0, /*tp_alloc*/
25911  __pyx_tp_new_array, /*tp_new*/
25912  0, /*tp_free*/
25913  0, /*tp_is_gc*/
25914  0, /*tp_bases*/
25915  0, /*tp_mro*/
25916  0, /*tp_cache*/
25917  0, /*tp_subclasses*/
25918  0, /*tp_weaklist*/
25919  0, /*tp_del*/
25920  0, /*tp_version_tag*/
25921  #if PY_VERSION_HEX >= 0x030400a1
25922  0, /*tp_finalize*/
25923  #endif
25924  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25925  0, /*tp_vectorcall*/
25926  #endif
25927  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25928  0, /*tp_print*/
25929  #endif
25930  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25931  0, /*tp_pypy_flags*/
25932  #endif
25933 };
25934 
25935 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25936  struct __pyx_MemviewEnum_obj *p;
25937  PyObject *o;
25938  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25939  o = (*t->tp_alloc)(t, 0);
25940  } else {
25941  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25942  }
25943  if (unlikely(!o)) return 0;
25944  p = ((struct __pyx_MemviewEnum_obj *)o);
25945  p->name = Py_None; Py_INCREF(Py_None);
25946  return o;
25947 }
25948 
25949 static void __pyx_tp_dealloc_Enum(PyObject *o) {
25950  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25951  #if CYTHON_USE_TP_FINALIZE
25952  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25953  if (PyObject_CallFinalizerFromDealloc(o)) return;
25954  }
25955  #endif
25956  PyObject_GC_UnTrack(o);
25957  Py_CLEAR(p->name);
25958  (*Py_TYPE(o)->tp_free)(o);
25959 }
25960 
25961 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
25962  int e;
25963  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25964  if (p->name) {
25965  e = (*v)(p->name, a); if (e) return e;
25966  }
25967  return 0;
25968 }
25969 
25970 static int __pyx_tp_clear_Enum(PyObject *o) {
25971  PyObject* tmp;
25972  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25973  tmp = ((PyObject*)p->name);
25974  p->name = Py_None; Py_INCREF(Py_None);
25975  Py_XDECREF(tmp);
25976  return 0;
25977 }
25978 
25979 static PyMethodDef __pyx_methods_Enum[] = {
25980  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
25981  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
25982  {0, 0, 0, 0}
25983 };
25984 
25985 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25986  PyVarObject_HEAD_INIT(0, 0)
25987  "imate._c_linear_operator.py_c_affine_matrix_function.Enum", /*tp_name*/
25988  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
25989  0, /*tp_itemsize*/
25990  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
25991  #if PY_VERSION_HEX < 0x030800b4
25992  0, /*tp_print*/
25993  #endif
25994  #if PY_VERSION_HEX >= 0x030800b4
25995  0, /*tp_vectorcall_offset*/
25996  #endif
25997  0, /*tp_getattr*/
25998  0, /*tp_setattr*/
25999  #if PY_MAJOR_VERSION < 3
26000  0, /*tp_compare*/
26001  #endif
26002  #if PY_MAJOR_VERSION >= 3
26003  0, /*tp_as_async*/
26004  #endif
26005  __pyx_MemviewEnum___repr__, /*tp_repr*/
26006  0, /*tp_as_number*/
26007  0, /*tp_as_sequence*/
26008  0, /*tp_as_mapping*/
26009  0, /*tp_hash*/
26010  0, /*tp_call*/
26011  0, /*tp_str*/
26012  0, /*tp_getattro*/
26013  0, /*tp_setattro*/
26014  0, /*tp_as_buffer*/
26015  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26016  0, /*tp_doc*/
26017  __pyx_tp_traverse_Enum, /*tp_traverse*/
26018  __pyx_tp_clear_Enum, /*tp_clear*/
26019  0, /*tp_richcompare*/
26020  0, /*tp_weaklistoffset*/
26021  0, /*tp_iter*/
26022  0, /*tp_iternext*/
26023  __pyx_methods_Enum, /*tp_methods*/
26024  0, /*tp_members*/
26025  0, /*tp_getset*/
26026  0, /*tp_base*/
26027  0, /*tp_dict*/
26028  0, /*tp_descr_get*/
26029  0, /*tp_descr_set*/
26030  0, /*tp_dictoffset*/
26031  __pyx_MemviewEnum___init__, /*tp_init*/
26032  0, /*tp_alloc*/
26033  __pyx_tp_new_Enum, /*tp_new*/
26034  0, /*tp_free*/
26035  0, /*tp_is_gc*/
26036  0, /*tp_bases*/
26037  0, /*tp_mro*/
26038  0, /*tp_cache*/
26039  0, /*tp_subclasses*/
26040  0, /*tp_weaklist*/
26041  0, /*tp_del*/
26042  0, /*tp_version_tag*/
26043  #if PY_VERSION_HEX >= 0x030400a1
26044  0, /*tp_finalize*/
26045  #endif
26046  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26047  0, /*tp_vectorcall*/
26048  #endif
26049  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26050  0, /*tp_print*/
26051  #endif
26052  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26053  0, /*tp_pypy_flags*/
26054  #endif
26055 };
26056 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
26057 
26058 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
26059  struct __pyx_memoryview_obj *p;
26060  PyObject *o;
26061  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
26062  o = (*t->tp_alloc)(t, 0);
26063  } else {
26064  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
26065  }
26066  if (unlikely(!o)) return 0;
26067  p = ((struct __pyx_memoryview_obj *)o);
26068  p->__pyx_vtab = __pyx_vtabptr_memoryview;
26069  p->obj = Py_None; Py_INCREF(Py_None);
26070  p->_size = Py_None; Py_INCREF(Py_None);
26071  p->_array_interface = Py_None; Py_INCREF(Py_None);
26072  p->view.obj = NULL;
26073  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
26074  return o;
26075  bad:
26076  Py_DECREF(o); o = 0;
26077  return NULL;
26078 }
26079 
26080 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
26081  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26082  #if CYTHON_USE_TP_FINALIZE
26083  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26084  if (PyObject_CallFinalizerFromDealloc(o)) return;
26085  }
26086  #endif
26087  PyObject_GC_UnTrack(o);
26088  {
26089  PyObject *etype, *eval, *etb;
26090  PyErr_Fetch(&etype, &eval, &etb);
26091  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26092  __pyx_memoryview___dealloc__(o);
26093  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26094  PyErr_Restore(etype, eval, etb);
26095  }
26096  Py_CLEAR(p->obj);
26097  Py_CLEAR(p->_size);
26098  Py_CLEAR(p->_array_interface);
26099  (*Py_TYPE(o)->tp_free)(o);
26100 }
26101 
26102 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
26103  int e;
26104  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26105  if (p->obj) {
26106  e = (*v)(p->obj, a); if (e) return e;
26107  }
26108  if (p->_size) {
26109  e = (*v)(p->_size, a); if (e) return e;
26110  }
26111  if (p->_array_interface) {
26112  e = (*v)(p->_array_interface, a); if (e) return e;
26113  }
26114  if (p->view.obj) {
26115  e = (*v)(p->view.obj, a); if (e) return e;
26116  }
26117  return 0;
26118 }
26119 
26120 static int __pyx_tp_clear_memoryview(PyObject *o) {
26121  PyObject* tmp;
26122  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26123  tmp = ((PyObject*)p->obj);
26124  p->obj = Py_None; Py_INCREF(Py_None);
26125  Py_XDECREF(tmp);
26126  tmp = ((PyObject*)p->_size);
26127  p->_size = Py_None; Py_INCREF(Py_None);
26128  Py_XDECREF(tmp);
26129  tmp = ((PyObject*)p->_array_interface);
26130  p->_array_interface = Py_None; Py_INCREF(Py_None);
26131  Py_XDECREF(tmp);
26132  Py_CLEAR(p->view.obj);
26133  return 0;
26134 }
26135 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26136  PyObject *r;
26137  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
26138  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
26139  Py_DECREF(x);
26140  return r;
26141 }
26142 
26143 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
26144  if (v) {
26145  return __pyx_memoryview___setitem__(o, i, v);
26146  }
26147  else {
26148  PyErr_Format(PyExc_NotImplementedError,
26149  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
26150  return -1;
26151  }
26152 }
26153 
26154 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
26155  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
26156 }
26157 
26158 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
26159  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
26160 }
26161 
26162 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
26163  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
26164 }
26165 
26166 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
26167  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
26168 }
26169 
26170 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
26171  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
26172 }
26173 
26174 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
26175  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
26176 }
26177 
26178 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
26179  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
26180 }
26181 
26182 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
26183  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
26184 }
26185 
26186 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
26187  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
26188 }
26189 
26190 static PyMethodDef __pyx_methods_memoryview[] = {
26191  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
26192  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
26193  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
26194  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
26195  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
26196  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
26197  {0, 0, 0, 0}
26198 };
26199 
26200 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
26201  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
26202  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
26203  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
26204  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
26205  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
26206  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
26207  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
26208  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
26209  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
26210  {0, 0, 0, 0, 0}
26211 };
26212 
26213 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
26214  __pyx_memoryview___len__, /*sq_length*/
26215  0, /*sq_concat*/
26216  0, /*sq_repeat*/
26217  __pyx_sq_item_memoryview, /*sq_item*/
26218  0, /*sq_slice*/
26219  0, /*sq_ass_item*/
26220  0, /*sq_ass_slice*/
26221  0, /*sq_contains*/
26222  0, /*sq_inplace_concat*/
26223  0, /*sq_inplace_repeat*/
26224 };
26225 
26226 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
26227  __pyx_memoryview___len__, /*mp_length*/
26228  __pyx_memoryview___getitem__, /*mp_subscript*/
26229  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
26230 };
26231 
26232 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26233  #if PY_MAJOR_VERSION < 3
26234  0, /*bf_getreadbuffer*/
26235  #endif
26236  #if PY_MAJOR_VERSION < 3
26237  0, /*bf_getwritebuffer*/
26238  #endif
26239  #if PY_MAJOR_VERSION < 3
26240  0, /*bf_getsegcount*/
26241  #endif
26242  #if PY_MAJOR_VERSION < 3
26243  0, /*bf_getcharbuffer*/
26244  #endif
26245  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
26246  0, /*bf_releasebuffer*/
26247 };
26248 
26249 static PyTypeObject __pyx_type___pyx_memoryview = {
26250  PyVarObject_HEAD_INIT(0, 0)
26251  "imate._c_linear_operator.py_c_affine_matrix_function.memoryview", /*tp_name*/
26252  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
26253  0, /*tp_itemsize*/
26254  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
26255  #if PY_VERSION_HEX < 0x030800b4
26256  0, /*tp_print*/
26257  #endif
26258  #if PY_VERSION_HEX >= 0x030800b4
26259  0, /*tp_vectorcall_offset*/
26260  #endif
26261  0, /*tp_getattr*/
26262  0, /*tp_setattr*/
26263  #if PY_MAJOR_VERSION < 3
26264  0, /*tp_compare*/
26265  #endif
26266  #if PY_MAJOR_VERSION >= 3
26267  0, /*tp_as_async*/
26268  #endif
26269  __pyx_memoryview___repr__, /*tp_repr*/
26270  0, /*tp_as_number*/
26271  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
26272  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
26273  0, /*tp_hash*/
26274  0, /*tp_call*/
26275  __pyx_memoryview___str__, /*tp_str*/
26276  0, /*tp_getattro*/
26277  0, /*tp_setattro*/
26278  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
26279  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26280  0, /*tp_doc*/
26281  __pyx_tp_traverse_memoryview, /*tp_traverse*/
26282  __pyx_tp_clear_memoryview, /*tp_clear*/
26283  0, /*tp_richcompare*/
26284  0, /*tp_weaklistoffset*/
26285  0, /*tp_iter*/
26286  0, /*tp_iternext*/
26287  __pyx_methods_memoryview, /*tp_methods*/
26288  0, /*tp_members*/
26289  __pyx_getsets_memoryview, /*tp_getset*/
26290  0, /*tp_base*/
26291  0, /*tp_dict*/
26292  0, /*tp_descr_get*/
26293  0, /*tp_descr_set*/
26294  0, /*tp_dictoffset*/
26295  0, /*tp_init*/
26296  0, /*tp_alloc*/
26297  __pyx_tp_new_memoryview, /*tp_new*/
26298  0, /*tp_free*/
26299  0, /*tp_is_gc*/
26300  0, /*tp_bases*/
26301  0, /*tp_mro*/
26302  0, /*tp_cache*/
26303  0, /*tp_subclasses*/
26304  0, /*tp_weaklist*/
26305  0, /*tp_del*/
26306  0, /*tp_version_tag*/
26307  #if PY_VERSION_HEX >= 0x030400a1
26308  0, /*tp_finalize*/
26309  #endif
26310  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26311  0, /*tp_vectorcall*/
26312  #endif
26313  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26314  0, /*tp_print*/
26315  #endif
26316  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26317  0, /*tp_pypy_flags*/
26318  #endif
26319 };
26320 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26321 
26322 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26323  struct __pyx_memoryviewslice_obj *p;
26324  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
26325  if (unlikely(!o)) return 0;
26326  p = ((struct __pyx_memoryviewslice_obj *)o);
26327  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26328  p->from_object = Py_None; Py_INCREF(Py_None);
26329  p->from_slice.memview = NULL;
26330  return o;
26331 }
26332 
26333 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26334  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26335  #if CYTHON_USE_TP_FINALIZE
26336  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26337  if (PyObject_CallFinalizerFromDealloc(o)) return;
26338  }
26339  #endif
26340  PyObject_GC_UnTrack(o);
26341  {
26342  PyObject *etype, *eval, *etb;
26343  PyErr_Fetch(&etype, &eval, &etb);
26344  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26345  __pyx_memoryviewslice___dealloc__(o);
26346  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26347  PyErr_Restore(etype, eval, etb);
26348  }
26349  Py_CLEAR(p->from_object);
26350  PyObject_GC_Track(o);
26351  __pyx_tp_dealloc_memoryview(o);
26352 }
26353 
26354 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
26355  int e;
26356  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26357  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
26358  if (p->from_object) {
26359  e = (*v)(p->from_object, a); if (e) return e;
26360  }
26361  return 0;
26362 }
26363 
26364 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26365  PyObject* tmp;
26366  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26367  __pyx_tp_clear_memoryview(o);
26368  tmp = ((PyObject*)p->from_object);
26369  p->from_object = Py_None; Py_INCREF(Py_None);
26370  Py_XDECREF(tmp);
26371  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
26372  return 0;
26373 }
26374 
26375 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
26376  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
26377 }
26378 
26379 static PyMethodDef __pyx_methods__memoryviewslice[] = {
26380  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
26381  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
26382  {0, 0, 0, 0}
26383 };
26384 
26385 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
26386  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
26387  {0, 0, 0, 0, 0}
26388 };
26389 
26390 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26391  PyVarObject_HEAD_INIT(0, 0)
26392  "imate._c_linear_operator.py_c_affine_matrix_function._memoryviewslice", /*tp_name*/
26393  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
26394  0, /*tp_itemsize*/
26395  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
26396  #if PY_VERSION_HEX < 0x030800b4
26397  0, /*tp_print*/
26398  #endif
26399  #if PY_VERSION_HEX >= 0x030800b4
26400  0, /*tp_vectorcall_offset*/
26401  #endif
26402  0, /*tp_getattr*/
26403  0, /*tp_setattr*/
26404  #if PY_MAJOR_VERSION < 3
26405  0, /*tp_compare*/
26406  #endif
26407  #if PY_MAJOR_VERSION >= 3
26408  0, /*tp_as_async*/
26409  #endif
26410  #if CYTHON_COMPILING_IN_PYPY
26411  __pyx_memoryview___repr__, /*tp_repr*/
26412  #else
26413  0, /*tp_repr*/
26414  #endif
26415  0, /*tp_as_number*/
26416  0, /*tp_as_sequence*/
26417  0, /*tp_as_mapping*/
26418  0, /*tp_hash*/
26419  0, /*tp_call*/
26420  #if CYTHON_COMPILING_IN_PYPY
26421  __pyx_memoryview___str__, /*tp_str*/
26422  #else
26423  0, /*tp_str*/
26424  #endif
26425  0, /*tp_getattro*/
26426  0, /*tp_setattro*/
26427  0, /*tp_as_buffer*/
26428  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26429  "Internal class for passing memoryview slices to Python", /*tp_doc*/
26430  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
26431  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
26432  0, /*tp_richcompare*/
26433  0, /*tp_weaklistoffset*/
26434  0, /*tp_iter*/
26435  0, /*tp_iternext*/
26436  __pyx_methods__memoryviewslice, /*tp_methods*/
26437  0, /*tp_members*/
26438  __pyx_getsets__memoryviewslice, /*tp_getset*/
26439  0, /*tp_base*/
26440  0, /*tp_dict*/
26441  0, /*tp_descr_get*/
26442  0, /*tp_descr_set*/
26443  0, /*tp_dictoffset*/
26444  0, /*tp_init*/
26445  0, /*tp_alloc*/
26446  __pyx_tp_new__memoryviewslice, /*tp_new*/
26447  0, /*tp_free*/
26448  0, /*tp_is_gc*/
26449  0, /*tp_bases*/
26450  0, /*tp_mro*/
26451  0, /*tp_cache*/
26452  0, /*tp_subclasses*/
26453  0, /*tp_weaklist*/
26454  0, /*tp_del*/
26455  0, /*tp_version_tag*/
26456  #if PY_VERSION_HEX >= 0x030400a1
26457  0, /*tp_finalize*/
26458  #endif
26459  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26460  0, /*tp_vectorcall*/
26461  #endif
26462  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26463  0, /*tp_print*/
26464  #endif
26465  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26466  0, /*tp_pypy_flags*/
26467  #endif
26468 };
26469 
26470 static PyMethodDef __pyx_methods[] = {
26471  {0, 0, 0, 0}
26472 };
26473 
26474 #if PY_MAJOR_VERSION >= 3
26475 #if CYTHON_PEP489_MULTI_PHASE_INIT
26476 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
26477 static int __pyx_pymod_exec_py_c_affine_matrix_function(PyObject* module); /*proto*/
26478 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26479  {Py_mod_create, (void*)__pyx_pymod_create},
26480  {Py_mod_exec, (void*)__pyx_pymod_exec_py_c_affine_matrix_function},
26481  {0, NULL}
26482 };
26483 #endif
26484 
26485 static struct PyModuleDef __pyx_moduledef = {
26486  PyModuleDef_HEAD_INIT,
26487  "py_c_affine_matrix_function",
26488  0, /* m_doc */
26489  #if CYTHON_PEP489_MULTI_PHASE_INIT
26490  0, /* m_size */
26491  #else
26492  -1, /* m_size */
26493  #endif
26494  __pyx_methods /* m_methods */,
26495  #if CYTHON_PEP489_MULTI_PHASE_INIT
26496  __pyx_moduledef_slots, /* m_slots */
26497  #else
26498  NULL, /* m_reload */
26499  #endif
26500  NULL, /* m_traverse */
26501  NULL, /* m_clear */
26502  NULL /* m_free */
26503 };
26504 #endif
26505 #ifndef CYTHON_SMALL_CODE
26506 #if defined(__clang__)
26507  #define CYTHON_SMALL_CODE
26508 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
26509  #define CYTHON_SMALL_CODE __attribute__((cold))
26510 #else
26511  #define CYTHON_SMALL_CODE
26512 #endif
26513 #endif
26514 
26515 static __Pyx_StringTabEntry __pyx_string_tab[] = {
26516  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
26517  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
26518  {&__pyx_kp_u_A_and_B_should_have_similar_data, __pyx_k_A_and_B_should_have_similar_data, sizeof(__pyx_k_A_and_B_should_have_similar_data), 0, 1, 0, 0},
26519  {&__pyx_kp_u_A_and_B_should_have_the_same_sha, __pyx_k_A_and_B_should_have_the_same_sha, sizeof(__pyx_k_A_and_B_should_have_the_same_sha), 0, 1, 0, 0},
26520  {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None, sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
26521  {&__pyx_n_s_A_data, __pyx_k_A_data, sizeof(__pyx_k_A_data), 0, 0, 1, 1},
26522  {&__pyx_n_s_A_data_mv, __pyx_k_A_data_mv, sizeof(__pyx_k_A_data_mv), 0, 0, 1, 1},
26523  {&__pyx_n_s_A_data_mv_c, __pyx_k_A_data_mv_c, sizeof(__pyx_k_A_data_mv_c), 0, 0, 1, 1},
26524  {&__pyx_n_s_A_data_mv_f, __pyx_k_A_data_mv_f, sizeof(__pyx_k_A_data_mv_f), 0, 0, 1, 1},
26525  {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer, sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
26526  {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv, sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
26527  {&__pyx_n_s_A_indices, __pyx_k_A_indices, sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
26528  {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv, sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
26529  {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major, sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
26530  {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns, sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
26531  {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows, sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
26532  {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
26533  {&__pyx_n_s_B_data, __pyx_k_B_data, sizeof(__pyx_k_B_data), 0, 0, 1, 1},
26534  {&__pyx_n_s_B_data_mv, __pyx_k_B_data_mv, sizeof(__pyx_k_B_data_mv), 0, 0, 1, 1},
26535  {&__pyx_n_s_B_data_mv_c, __pyx_k_B_data_mv_c, sizeof(__pyx_k_B_data_mv_c), 0, 0, 1, 1},
26536  {&__pyx_n_s_B_data_mv_f, __pyx_k_B_data_mv_f, sizeof(__pyx_k_B_data_mv_f), 0, 0, 1, 1},
26537  {&__pyx_n_s_B_index_pointer, __pyx_k_B_index_pointer, sizeof(__pyx_k_B_index_pointer), 0, 0, 1, 1},
26538  {&__pyx_n_s_B_index_pointer_mv, __pyx_k_B_index_pointer_mv, sizeof(__pyx_k_B_index_pointer_mv), 0, 0, 1, 1},
26539  {&__pyx_n_s_B_indices, __pyx_k_B_indices, sizeof(__pyx_k_B_indices), 0, 0, 1, 1},
26540  {&__pyx_n_s_B_indices_mv, __pyx_k_B_indices_mv, sizeof(__pyx_k_B_indices_mv), 0, 0, 1, 1},
26541  {&__pyx_n_s_B_is_identity, __pyx_k_B_is_identity, sizeof(__pyx_k_B_is_identity), 0, 0, 1, 1},
26542  {&__pyx_n_s_B_is_row_major, __pyx_k_B_is_row_major, sizeof(__pyx_k_B_is_row_major), 0, 0, 1, 1},
26543  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
26544  {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
26545  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
26546  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
26547  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
26548  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
26549  {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa, sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
26550  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
26551  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
26552  {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS, sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
26553  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
26554  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
26555  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
26556  {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen, sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
26557  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
26558  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
26559  {&__pyx_kp_u_Matrices_A_and_B_should_have_sim, __pyx_k_Matrices_A_and_B_should_have_sim, sizeof(__pyx_k_Matrices_A_and_B_should_have_sim), 0, 1, 0, 0},
26560  {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F, sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
26561  {&__pyx_kp_u_Matrix_B_should_be_either_C_or_F, __pyx_k_Matrix_B_should_be_either_C_or_F, sizeof(__pyx_k_Matrix_B_should_be_either_C_or_F), 0, 1, 0, 0},
26562  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
26563  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
26564  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
26565  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
26566  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
26567  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
26568  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
26569  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
26570  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
26571  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
26572  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
26573  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
26574  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
26575  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
26576  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
26577  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
26578  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
26579  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
26580  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
26581  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
26582  {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix, sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
26583  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
26584  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
26585  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
26586  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
26587  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
26588  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
26589  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
26590  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
26591  {&__pyx_n_b_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 0, 1},
26592  {&__pyx_n_b_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 0, 1},
26593  {&__pyx_n_b_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 0, 1},
26594  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
26595  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
26596  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
26597  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
26598  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
26599  {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices, sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
26600  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
26601  {&__pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_k_imate__c_linear_operator_py_c_af, sizeof(__pyx_k_imate__c_linear_operator_py_c_af), 0, 0, 1, 0},
26602  {&__pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_k_imate__c_linear_operator_py_c_af_2, sizeof(__pyx_k_imate__c_linear_operator_py_c_af_2), 0, 0, 1, 1},
26603  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
26604  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
26605  {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
26606  {&__pyx_n_s_issparse, __pyx_k_issparse, sizeof(__pyx_k_issparse), 0, 0, 1, 1},
26607  {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc, sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
26608  {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr, sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
26609  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
26610  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
26611  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
26612  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
26613  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
26614  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
26615  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
26616  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
26617  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
26618  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
26619  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
26620  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
26621  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
26622  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
26623  {&__pyx_n_s_pycAffineMatrixFunction, __pyx_k_pycAffineMatrixFunction, sizeof(__pyx_k_pycAffineMatrixFunction), 0, 0, 1, 1},
26624  {&__pyx_n_s_pycAffineMatrixFunction___reduce, __pyx_k_pycAffineMatrixFunction___reduce, sizeof(__pyx_k_pycAffineMatrixFunction___reduce), 0, 0, 1, 1},
26625  {&__pyx_n_s_pycAffineMatrixFunction___setsta, __pyx_k_pycAffineMatrixFunction___setsta, sizeof(__pyx_k_pycAffineMatrixFunction___setsta), 0, 0, 1, 1},
26626  {&__pyx_n_s_pycAffineMatrixFunction_set_csc, __pyx_k_pycAffineMatrixFunction_set_csc, sizeof(__pyx_k_pycAffineMatrixFunction_set_csc), 0, 0, 1, 1},
26627  {&__pyx_n_s_pycAffineMatrixFunction_set_csc_2, __pyx_k_pycAffineMatrixFunction_set_csc_2, sizeof(__pyx_k_pycAffineMatrixFunction_set_csc_2), 0, 0, 1, 1},
26628  {&__pyx_n_s_pycAffineMatrixFunction_set_csc_3, __pyx_k_pycAffineMatrixFunction_set_csc_3, sizeof(__pyx_k_pycAffineMatrixFunction_set_csc_3), 0, 0, 1, 1},
26629  {&__pyx_n_s_pycAffineMatrixFunction_set_csr, __pyx_k_pycAffineMatrixFunction_set_csr, sizeof(__pyx_k_pycAffineMatrixFunction_set_csr), 0, 0, 1, 1},
26630  {&__pyx_n_s_pycAffineMatrixFunction_set_csr_2, __pyx_k_pycAffineMatrixFunction_set_csr_2, sizeof(__pyx_k_pycAffineMatrixFunction_set_csr_2), 0, 0, 1, 1},
26631  {&__pyx_n_s_pycAffineMatrixFunction_set_csr_3, __pyx_k_pycAffineMatrixFunction_set_csr_3, sizeof(__pyx_k_pycAffineMatrixFunction_set_csr_3), 0, 0, 1, 1},
26632  {&__pyx_n_s_pycAffineMatrixFunction_set_dens, __pyx_k_pycAffineMatrixFunction_set_dens, sizeof(__pyx_k_pycAffineMatrixFunction_set_dens), 0, 0, 1, 1},
26633  {&__pyx_n_s_pycAffineMatrixFunction_set_dens_2, __pyx_k_pycAffineMatrixFunction_set_dens_2, sizeof(__pyx_k_pycAffineMatrixFunction_set_dens_2), 0, 0, 1, 1},
26634  {&__pyx_n_s_pycAffineMatrixFunction_set_dens_3, __pyx_k_pycAffineMatrixFunction_set_dens_3, sizeof(__pyx_k_pycAffineMatrixFunction_set_dens_3), 0, 0, 1, 1},
26635  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
26636  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
26637  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
26638  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
26639  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
26640  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
26641  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
26642  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26643  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
26644  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
26645  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
26646  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26647  {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
26648  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
26649  {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double, sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
26650  {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float, sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
26651  {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double, sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
26652  {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double, sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
26653  {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float, sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
26654  {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double, sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
26655  {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double, sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
26656  {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float, sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
26657  {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double, sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
26658  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
26659  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26660  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
26661  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
26662  {&__pyx_n_s_sort_indices, __pyx_k_sort_indices, sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
26663  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
26664  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
26665  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
26666  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
26667  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
26668  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
26669  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
26670  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
26671  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
26672  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
26673  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
26674  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
26675  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
26676  {0, 0, 0, 0, 0, 0, 0}
26677 };
26678 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
26679  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 179, __pyx_L1_error)
26680  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 192, __pyx_L1_error)
26681  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
26682  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
26683  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 181, __pyx_L1_error)
26684  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
26685  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
26686  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
26687  return 0;
26688  __pyx_L1_error:;
26689  return -1;
26690 }
26691 
26692 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
26693  __Pyx_RefNannyDeclarations
26694  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
26695 
26696  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":179
26697  * # Check A
26698  * if A is None:
26699  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
26700  *
26701  * if A.ndim != 2:
26702  */
26703  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 179, __pyx_L1_error)
26704  __Pyx_GOTREF(__pyx_tuple_);
26705  __Pyx_GIVEREF(__pyx_tuple_);
26706 
26707  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":182
26708  *
26709  * if A.ndim != 2:
26710  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
26711  *
26712  * # Data type
26713  */
26714  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 182, __pyx_L1_error)
26715  __Pyx_GOTREF(__pyx_tuple__2);
26716  __Pyx_GIVEREF(__pyx_tuple__2);
26717 
26718  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":192
26719  * self.data_type_name = b'float128'
26720  * else:
26721  * raise TypeError('Data type should be float32, float64, or ' + # <<<<<<<<<<<<<<
26722  * 'float128.')
26723  *
26724  */
26725  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 192, __pyx_L1_error)
26726  __Pyx_GOTREF(__pyx_tuple__3);
26727  __Pyx_GIVEREF(__pyx_tuple__3);
26728 
26729  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":208
26730  * # Check similar types of A and B
26731  * if not (type(A) == type(B)):
26732  * raise TypeError('Matrices A and B should have similar types.') # <<<<<<<<<<<<<<
26733  *
26734  * # Check A and B have the same data types
26735  */
26736  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Matrices_A_and_B_should_have_sim); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 208, __pyx_L1_error)
26737  __Pyx_GOTREF(__pyx_tuple__4);
26738  __Pyx_GIVEREF(__pyx_tuple__4);
26739 
26740  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":212
26741  * # Check A and B have the same data types
26742  * if not (A.dtype == B.dtype):
26743  * raise TypeError('A and B should have similar data types.') # <<<<<<<<<<<<<<
26744  *
26745  * # Check consistent sizes of A and B
26746  */
26747  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_A_and_B_should_have_similar_data); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 212, __pyx_L1_error)
26748  __Pyx_GOTREF(__pyx_tuple__5);
26749  __Pyx_GIVEREF(__pyx_tuple__5);
26750 
26751  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":216
26752  * # Check consistent sizes of A and B
26753  * if not (A.shape == B.shape):
26754  * raise ValueError('A and B should have the same shape.') # <<<<<<<<<<<<<<
26755  *
26756  * # Determine A is sparse or dense
26757  */
26758  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_A_and_B_should_have_the_same_sha); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 216, __pyx_L1_error)
26759  __Pyx_GOTREF(__pyx_tuple__6);
26760  __Pyx_GIVEREF(__pyx_tuple__6);
26761 
26762  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":327
26763  * A_is_row_major = 0
26764  * else:
26765  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
26766  *
26767  * if not B_is_identity:
26768  */
26769  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 327, __pyx_L1_error)
26770  __Pyx_GOTREF(__pyx_tuple__8);
26771  __Pyx_GIVEREF(__pyx_tuple__8);
26772 
26773  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":335
26774  * B_is_row_major = 0
26775  * else:
26776  * raise TypeError('Matrix B should be either C or F contiguous.') # <<<<<<<<<<<<<<
26777  *
26778  * # Declare memoryviews to get data pointer
26779  */
26780  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Matrix_B_should_be_either_C_or_F); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 335, __pyx_L1_error)
26781  __Pyx_GOTREF(__pyx_tuple__9);
26782  __Pyx_GIVEREF(__pyx_tuple__9);
26783 
26784  /* "(tree fragment)":2
26785  * def __reduce_cython__(self):
26786  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26787  * def __setstate_cython__(self, __pyx_state):
26788  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26789  */
26790  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
26791  __Pyx_GOTREF(__pyx_tuple__19);
26792  __Pyx_GIVEREF(__pyx_tuple__19);
26793 
26794  /* "(tree fragment)":4
26795  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26796  * def __setstate_cython__(self, __pyx_state):
26797  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26798  */
26799  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
26800  __Pyx_GOTREF(__pyx_tuple__21);
26801  __Pyx_GIVEREF(__pyx_tuple__21);
26802 
26803  /* "View.MemoryView":134
26804  *
26805  * if not self.ndim:
26806  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
26807  *
26808  * if itemsize <= 0:
26809  */
26810  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 134, __pyx_L1_error)
26811  __Pyx_GOTREF(__pyx_tuple__22);
26812  __Pyx_GIVEREF(__pyx_tuple__22);
26813 
26814  /* "View.MemoryView":137
26815  *
26816  * if itemsize <= 0:
26817  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
26818  *
26819  * if not isinstance(format, bytes):
26820  */
26821  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 137, __pyx_L1_error)
26822  __Pyx_GOTREF(__pyx_tuple__23);
26823  __Pyx_GIVEREF(__pyx_tuple__23);
26824 
26825  /* "View.MemoryView":149
26826  *
26827  * if not self._shape:
26828  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
26829  *
26830  *
26831  */
26832  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 149, __pyx_L1_error)
26833  __Pyx_GOTREF(__pyx_tuple__24);
26834  __Pyx_GIVEREF(__pyx_tuple__24);
26835 
26836  /* "View.MemoryView":177
26837  * self.data = <char *>malloc(self.len)
26838  * if not self.data:
26839  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
26840  *
26841  * if self.dtype_is_object:
26842  */
26843  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 177, __pyx_L1_error)
26844  __Pyx_GOTREF(__pyx_tuple__25);
26845  __Pyx_GIVEREF(__pyx_tuple__25);
26846 
26847  /* "View.MemoryView":193
26848  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
26849  * if not (flags & bufmode):
26850  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
26851  * info.buf = self.data
26852  * info.len = self.len
26853  */
26854  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 193, __pyx_L1_error)
26855  __Pyx_GOTREF(__pyx_tuple__26);
26856  __Pyx_GIVEREF(__pyx_tuple__26);
26857 
26858  /* "(tree fragment)":2
26859  * def __reduce_cython__(self):
26860  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26861  * def __setstate_cython__(self, __pyx_state):
26862  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26863  */
26864  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
26865  __Pyx_GOTREF(__pyx_tuple__27);
26866  __Pyx_GIVEREF(__pyx_tuple__27);
26867 
26868  /* "(tree fragment)":4
26869  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26870  * def __setstate_cython__(self, __pyx_state):
26871  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26872  */
26873  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
26874  __Pyx_GOTREF(__pyx_tuple__28);
26875  __Pyx_GIVEREF(__pyx_tuple__28);
26876 
26877  /* "View.MemoryView":420
26878  * def __setitem__(memoryview self, object index, object value):
26879  * if self.view.readonly:
26880  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
26881  *
26882  * have_slices, index = _unellipsify(index, self.view.ndim)
26883  */
26884  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 420, __pyx_L1_error)
26885  __Pyx_GOTREF(__pyx_tuple__29);
26886  __Pyx_GIVEREF(__pyx_tuple__29);
26887 
26888  /* "View.MemoryView":497
26889  * result = struct.unpack(self.view.format, bytesitem)
26890  * except struct.error:
26891  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
26892  * else:
26893  * if len(self.view.format) == 1:
26894  */
26895  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 497, __pyx_L1_error)
26896  __Pyx_GOTREF(__pyx_tuple__30);
26897  __Pyx_GIVEREF(__pyx_tuple__30);
26898 
26899  /* "View.MemoryView":522
26900  * def __getbuffer__(self, Py_buffer *info, int flags):
26901  * if flags & PyBUF_WRITABLE and self.view.readonly:
26902  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
26903  *
26904  * if flags & PyBUF_ND:
26905  */
26906  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 522, __pyx_L1_error)
26907  __Pyx_GOTREF(__pyx_tuple__31);
26908  __Pyx_GIVEREF(__pyx_tuple__31);
26909 
26910  /* "View.MemoryView":572
26911  * if self.view.strides == NULL:
26912  *
26913  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
26914  *
26915  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
26916  */
26917  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 572, __pyx_L1_error)
26918  __Pyx_GOTREF(__pyx_tuple__32);
26919  __Pyx_GIVEREF(__pyx_tuple__32);
26920 
26921  /* "View.MemoryView":579
26922  * def suboffsets(self):
26923  * if self.view.suboffsets == NULL:
26924  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
26925  *
26926  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
26927  */
26928  __pyx_tuple__33 = PyTuple_New(1); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 579, __pyx_L1_error)
26929  __Pyx_GOTREF(__pyx_tuple__33);
26930  __Pyx_INCREF(__pyx_int_neg_1);
26931  __Pyx_GIVEREF(__pyx_int_neg_1);
26932  PyTuple_SET_ITEM(__pyx_tuple__33, 0, __pyx_int_neg_1);
26933  __Pyx_GIVEREF(__pyx_tuple__33);
26934 
26935  /* "(tree fragment)":2
26936  * def __reduce_cython__(self):
26937  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26938  * def __setstate_cython__(self, __pyx_state):
26939  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26940  */
26941  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
26942  __Pyx_GOTREF(__pyx_tuple__34);
26943  __Pyx_GIVEREF(__pyx_tuple__34);
26944 
26945  /* "(tree fragment)":4
26946  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26947  * def __setstate_cython__(self, __pyx_state):
26948  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26949  */
26950  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
26951  __Pyx_GOTREF(__pyx_tuple__35);
26952  __Pyx_GIVEREF(__pyx_tuple__35);
26953 
26954  /* "View.MemoryView":684
26955  * if item is Ellipsis:
26956  * if not seen_ellipsis:
26957  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
26958  * seen_ellipsis = True
26959  * else:
26960  */
26961  __pyx_slice__36 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__36)) __PYX_ERR(1, 684, __pyx_L1_error)
26962  __Pyx_GOTREF(__pyx_slice__36);
26963  __Pyx_GIVEREF(__pyx_slice__36);
26964 
26965  /* "View.MemoryView":705
26966  * for suboffset in suboffsets[:ndim]:
26967  * if suboffset >= 0:
26968  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
26969  *
26970  *
26971  */
26972  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 705, __pyx_L1_error)
26973  __Pyx_GOTREF(__pyx_tuple__37);
26974  __Pyx_GIVEREF(__pyx_tuple__37);
26975 
26976  /* "(tree fragment)":2
26977  * def __reduce_cython__(self):
26978  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26979  * def __setstate_cython__(self, __pyx_state):
26980  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26981  */
26982  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 2, __pyx_L1_error)
26983  __Pyx_GOTREF(__pyx_tuple__38);
26984  __Pyx_GIVEREF(__pyx_tuple__38);
26985 
26986  /* "(tree fragment)":4
26987  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26988  * def __setstate_cython__(self, __pyx_state):
26989  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26990  */
26991  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 4, __pyx_L1_error)
26992  __Pyx_GOTREF(__pyx_tuple__39);
26993  __Pyx_GIVEREF(__pyx_tuple__39);
26994  __pyx_tuple__41 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 4, __pyx_L1_error)
26995  __Pyx_GOTREF(__pyx_tuple__41);
26996  __Pyx_GIVEREF(__pyx_tuple__41);
26997 
26998  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":306
26999  * # ======================
27000  *
27001  * def set_dense_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27002  * """
27003  * Sets matrix A.
27004  */
27005  __pyx_tuple__42 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 306, __pyx_L1_error)
27006  __Pyx_GOTREF(__pyx_tuple__42);
27007  __Pyx_GIVEREF(__pyx_tuple__42);
27008  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_float, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 306, __pyx_L1_error)
27009 
27010  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":402
27011  * # =======================
27012  *
27013  * def set_dense_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27014  * """
27015  * Sets matrix A.
27016  */
27017  __pyx_tuple__43 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 402, __pyx_L1_error)
27018  __Pyx_GOTREF(__pyx_tuple__43);
27019  __Pyx_GIVEREF(__pyx_tuple__43);
27020  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_double, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 402, __pyx_L1_error)
27021 
27022  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":498
27023  * # ============================
27024  *
27025  * def set_dense_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27026  * """
27027  * Sets matrix A.
27028  */
27029  __pyx_tuple__44 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 498, __pyx_L1_error)
27030  __Pyx_GOTREF(__pyx_tuple__44);
27031  __Pyx_GIVEREF(__pyx_tuple__44);
27032  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_long_double, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 498, __pyx_L1_error)
27033 
27034  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":594
27035  * # ====================
27036  *
27037  * def set_csr_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27038  * """
27039  * """
27040  */
27041  __pyx_tuple__45 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 594, __pyx_L1_error)
27042  __Pyx_GOTREF(__pyx_tuple__45);
27043  __Pyx_GIVEREF(__pyx_tuple__45);
27044  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_float, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 594, __pyx_L1_error)
27045 
27046  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":665
27047  * # =====================
27048  *
27049  * def set_csr_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27050  * """
27051  * """
27052  */
27053  __pyx_tuple__46 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 665, __pyx_L1_error)
27054  __Pyx_GOTREF(__pyx_tuple__46);
27055  __Pyx_GIVEREF(__pyx_tuple__46);
27056  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_double, 665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 665, __pyx_L1_error)
27057 
27058  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":736
27059  * # ==========================
27060  *
27061  * def set_csr_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27062  * """
27063  * """
27064  */
27065  __pyx_tuple__47 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 736, __pyx_L1_error)
27066  __Pyx_GOTREF(__pyx_tuple__47);
27067  __Pyx_GIVEREF(__pyx_tuple__47);
27068  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_long_double, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 736, __pyx_L1_error)
27069 
27070  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":807
27071  * # ====================
27072  *
27073  * def set_csc_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27074  * """
27075  * """
27076  */
27077  __pyx_tuple__48 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 807, __pyx_L1_error)
27078  __Pyx_GOTREF(__pyx_tuple__48);
27079  __Pyx_GIVEREF(__pyx_tuple__48);
27080  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_float, 807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 807, __pyx_L1_error)
27081 
27082  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":878
27083  * # =====================
27084  *
27085  * def set_csc_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27086  * """
27087  * """
27088  */
27089  __pyx_tuple__49 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 878, __pyx_L1_error)
27090  __Pyx_GOTREF(__pyx_tuple__49);
27091  __Pyx_GIVEREF(__pyx_tuple__49);
27092  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_double, 878, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 878, __pyx_L1_error)
27093 
27094  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":949
27095  * # ==========================
27096  *
27097  * def set_csc_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27098  * """
27099  * """
27100  */
27101  __pyx_tuple__50 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 949, __pyx_L1_error)
27102  __Pyx_GOTREF(__pyx_tuple__50);
27103  __Pyx_GIVEREF(__pyx_tuple__50);
27104  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_long_double, 949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 949, __pyx_L1_error)
27105 
27106  /* "(tree fragment)":1
27107  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
27108  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27109  * def __setstate_cython__(self, __pyx_state):
27110  */
27111  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 1, __pyx_L1_error)
27112  __Pyx_GOTREF(__pyx_tuple__51);
27113  __Pyx_GIVEREF(__pyx_tuple__51);
27114  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 1, __pyx_L1_error)
27115 
27116  /* "(tree fragment)":3
27117  * def __reduce_cython__(self):
27118  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27119  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
27120  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27121  */
27122  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 3, __pyx_L1_error)
27123  __Pyx_GOTREF(__pyx_tuple__52);
27124  __Pyx_GIVEREF(__pyx_tuple__52);
27125  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 3, __pyx_L1_error)
27126 
27127  /* "View.MemoryView":287
27128  * return self.name
27129  *
27130  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
27131  * cdef strided = Enum("<strided and direct>") # default
27132  * cdef indirect = Enum("<strided and indirect>")
27133  */
27134  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 287, __pyx_L1_error)
27135  __Pyx_GOTREF(__pyx_tuple__53);
27136  __Pyx_GIVEREF(__pyx_tuple__53);
27137 
27138  /* "View.MemoryView":288
27139  *
27140  * cdef generic = Enum("<strided and direct or indirect>")
27141  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
27142  * cdef indirect = Enum("<strided and indirect>")
27143  *
27144  */
27145  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 288, __pyx_L1_error)
27146  __Pyx_GOTREF(__pyx_tuple__54);
27147  __Pyx_GIVEREF(__pyx_tuple__54);
27148 
27149  /* "View.MemoryView":289
27150  * cdef generic = Enum("<strided and direct or indirect>")
27151  * cdef strided = Enum("<strided and direct>") # default
27152  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
27153  *
27154  *
27155  */
27156  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 289, __pyx_L1_error)
27157  __Pyx_GOTREF(__pyx_tuple__55);
27158  __Pyx_GIVEREF(__pyx_tuple__55);
27159 
27160  /* "View.MemoryView":292
27161  *
27162  *
27163  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
27164  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27165  *
27166  */
27167  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 292, __pyx_L1_error)
27168  __Pyx_GOTREF(__pyx_tuple__56);
27169  __Pyx_GIVEREF(__pyx_tuple__56);
27170 
27171  /* "View.MemoryView":293
27172  *
27173  * cdef contiguous = Enum("<contiguous and direct>")
27174  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
27175  *
27176  *
27177  */
27178  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 293, __pyx_L1_error)
27179  __Pyx_GOTREF(__pyx_tuple__57);
27180  __Pyx_GIVEREF(__pyx_tuple__57);
27181 
27182  /* "(tree fragment)":1
27183  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
27184  * cdef object __pyx_PickleError
27185  * cdef object __pyx_result
27186  */
27187  __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 1, __pyx_L1_error)
27188  __Pyx_GOTREF(__pyx_tuple__58);
27189  __Pyx_GIVEREF(__pyx_tuple__58);
27190  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 1, __pyx_L1_error)
27191  __Pyx_RefNannyFinishContext();
27192  return 0;
27193  __pyx_L1_error:;
27194  __Pyx_RefNannyFinishContext();
27195  return -1;
27196 }
27197 
27198 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
27199  /* AssertionsEnabled.init */
27200  __Pyx_init_assertions_enabled();
27201 
27202 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
27203 
27204  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27205  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
27206  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27207  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
27208  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
27209  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
27210  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
27211  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27212  return 0;
27213  __pyx_L1_error:;
27214  return -1;
27215 }
27216 
27217 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
27218 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
27219 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
27220 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
27221 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
27222 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
27223 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
27224 
27225 static int __Pyx_modinit_global_init_code(void) {
27226  __Pyx_RefNannyDeclarations
27227  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
27228  /*--- Global init code ---*/
27229  generic = Py_None; Py_INCREF(Py_None);
27230  strided = Py_None; Py_INCREF(Py_None);
27231  indirect = Py_None; Py_INCREF(Py_None);
27232  contiguous = Py_None; Py_INCREF(Py_None);
27233  indirect_contiguous = Py_None; Py_INCREF(Py_None);
27234  __Pyx_RefNannyFinishContext();
27235  return 0;
27236 }
27237 
27238 static int __Pyx_modinit_variable_export_code(void) {
27239  __Pyx_RefNannyDeclarations
27240  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
27241  /*--- Variable export code ---*/
27242  __Pyx_RefNannyFinishContext();
27243  return 0;
27244 }
27245 
27246 static int __Pyx_modinit_function_export_code(void) {
27247  __Pyx_RefNannyDeclarations
27248  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
27249  /*--- Function export code ---*/
27250  __Pyx_RefNannyFinishContext();
27251  return 0;
27252 }
27253 
27254 static int __Pyx_modinit_type_init_code(void) {
27255  __Pyx_RefNannyDeclarations
27256  PyObject *__pyx_t_1 = NULL;
27257  int __pyx_lineno = 0;
27258  const char *__pyx_filename = NULL;
27259  int __pyx_clineno = 0;
27260  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
27261  /*--- Type init code ---*/
27262  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_linear_operator"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27263  __Pyx_GOTREF(__pyx_t_1);
27264  __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType_0_29_36(__pyx_t_1, "imate._c_linear_operator.py_c_linear_operator", "pycLinearOperator", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
27265  __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
27266  __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = &__pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
27267  __pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
27268  __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
27269  if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27270  #if PY_VERSION_HEX < 0x030800B1
27271  __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_print = 0;
27272  #endif
27273  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_getattro == PyObject_GenericGetAttr)) {
27274  __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27275  }
27276  if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27277  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycAffineMatrixFunction, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27278  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27279  __pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = &__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
27280  __pyx_vtabptr_array = &__pyx_vtable_array;
27281  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
27282  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
27283  #if PY_VERSION_HEX < 0x030800B1
27284  __pyx_type___pyx_array.tp_print = 0;
27285  #endif
27286  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
27287  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
27288  __pyx_array_type = &__pyx_type___pyx_array;
27289  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
27290  #if PY_VERSION_HEX < 0x030800B1
27291  __pyx_type___pyx_MemviewEnum.tp_print = 0;
27292  #endif
27293  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
27294  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27295  }
27296  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
27297  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27298  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
27299  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
27300  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
27301  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
27302  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
27303  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
27304  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
27305  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
27306  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
27307  #if PY_VERSION_HEX < 0x030800B1
27308  __pyx_type___pyx_memoryview.tp_print = 0;
27309  #endif
27310  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
27311  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27312  }
27313  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
27314  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
27315  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27316  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27317  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27318  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
27319  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27320  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
27321  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
27322  #if PY_VERSION_HEX < 0x030800B1
27323  __pyx_type___pyx_memoryviewslice.tp_print = 0;
27324  #endif
27325  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
27326  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27327  }
27328  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
27329  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
27330  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27331  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27332  __Pyx_RefNannyFinishContext();
27333  return 0;
27334  __pyx_L1_error:;
27335  __Pyx_XDECREF(__pyx_t_1);
27336  __Pyx_RefNannyFinishContext();
27337  return -1;
27338 }
27339 
27340 static int __Pyx_modinit_type_import_code(void) {
27341  __Pyx_RefNannyDeclarations
27342  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
27343  /*--- Type import code ---*/
27344  __Pyx_RefNannyFinishContext();
27345  return 0;
27346 }
27347 
27348 static int __Pyx_modinit_variable_import_code(void) {
27349  __Pyx_RefNannyDeclarations
27350  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
27351  /*--- Variable import code ---*/
27352  __Pyx_RefNannyFinishContext();
27353  return 0;
27354 }
27355 
27356 static int __Pyx_modinit_function_import_code(void) {
27357  __Pyx_RefNannyDeclarations
27358  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
27359  /*--- Function import code ---*/
27360  __Pyx_RefNannyFinishContext();
27361  return 0;
27362 }
27363 
27364 
27365 #ifndef CYTHON_NO_PYINIT_EXPORT
27366 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27367 #elif PY_MAJOR_VERSION < 3
27368 #ifdef __cplusplus
27369 #define __Pyx_PyMODINIT_FUNC extern "C" void
27370 #else
27371 #define __Pyx_PyMODINIT_FUNC void
27372 #endif
27373 #else
27374 #ifdef __cplusplus
27375 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27376 #else
27377 #define __Pyx_PyMODINIT_FUNC PyObject *
27378 #endif
27379 #endif
27380 
27381 
27382 #if PY_MAJOR_VERSION < 3
27383 __Pyx_PyMODINIT_FUNC initpy_c_affine_matrix_function(void) CYTHON_SMALL_CODE; /*proto*/
27384 __Pyx_PyMODINIT_FUNC initpy_c_affine_matrix_function(void)
27385 #else
27386 __Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void) CYTHON_SMALL_CODE; /*proto*/
27387 __Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)
27388 #if CYTHON_PEP489_MULTI_PHASE_INIT
27389 {
27390  return PyModuleDef_Init(&__pyx_moduledef);
27391 }
27392 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
27393  #if PY_VERSION_HEX >= 0x030700A1
27394  static PY_INT64_T main_interpreter_id = -1;
27395  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27396  if (main_interpreter_id == -1) {
27397  main_interpreter_id = current_id;
27398  return (unlikely(current_id == -1)) ? -1 : 0;
27399  } else if (unlikely(main_interpreter_id != current_id))
27400  #else
27401  static PyInterpreterState *main_interpreter = NULL;
27402  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
27403  if (!main_interpreter) {
27404  main_interpreter = current_interpreter;
27405  } else if (unlikely(main_interpreter != current_interpreter))
27406  #endif
27407  {
27408  PyErr_SetString(
27409  PyExc_ImportError,
27410  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27411  return -1;
27412  }
27413  return 0;
27414 }
27415 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
27416  PyObject *value = PyObject_GetAttrString(spec, from_name);
27417  int result = 0;
27418  if (likely(value)) {
27419  if (allow_none || value != Py_None) {
27420  result = PyDict_SetItemString(moddict, to_name, value);
27421  }
27422  Py_DECREF(value);
27423  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27424  PyErr_Clear();
27425  } else {
27426  result = -1;
27427  }
27428  return result;
27429 }
27430 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
27431  PyObject *module = NULL, *moddict, *modname;
27432  if (__Pyx_check_single_interpreter())
27433  return NULL;
27434  if (__pyx_m)
27435  return __Pyx_NewRef(__pyx_m);
27436  modname = PyObject_GetAttrString(spec, "name");
27437  if (unlikely(!modname)) goto bad;
27438  module = PyModule_NewObject(modname);
27439  Py_DECREF(modname);
27440  if (unlikely(!module)) goto bad;
27441  moddict = PyModule_GetDict(module);
27442  if (unlikely(!moddict)) goto bad;
27443  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
27444  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
27445  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
27446  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
27447  return module;
27448 bad:
27449  Py_XDECREF(module);
27450  return NULL;
27451 }
27452 
27453 
27454 static CYTHON_SMALL_CODE int __pyx_pymod_exec_py_c_affine_matrix_function(PyObject *__pyx_pyinit_module)
27455 #endif
27456 #endif
27457 {
27458  __Pyx_TraceDeclarations
27459  PyObject *__pyx_t_1 = NULL;
27460  PyObject *__pyx_t_2 = NULL;
27461  static PyThread_type_lock __pyx_t_3[8];
27462  int __pyx_lineno = 0;
27463  const char *__pyx_filename = NULL;
27464  int __pyx_clineno = 0;
27465  __Pyx_RefNannyDeclarations
27466  #if CYTHON_PEP489_MULTI_PHASE_INIT
27467  if (__pyx_m) {
27468  if (__pyx_m == __pyx_pyinit_module) return 0;
27469  PyErr_SetString(PyExc_RuntimeError, "Module 'py_c_affine_matrix_function' has already been imported. Re-initialisation is not supported.");
27470  return -1;
27471  }
27472  #elif PY_MAJOR_VERSION >= 3
27473  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
27474  #endif
27475  #if CYTHON_REFNANNY
27476 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
27477 if (!__Pyx_RefNanny) {
27478  PyErr_Clear();
27479  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
27480  if (!__Pyx_RefNanny)
27481  Py_FatalError("failed to import 'refnanny' module");
27482 }
27483 #endif
27484  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)", 0);
27485  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27486  #ifdef __Pxy_PyFrame_Initialize_Offsets
27487  __Pxy_PyFrame_Initialize_Offsets();
27488  #endif
27489  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27490  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27491  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27492  #ifdef __Pyx_CyFunction_USED
27493  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27494  #endif
27495  #ifdef __Pyx_FusedFunction_USED
27496  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27497  #endif
27498  #ifdef __Pyx_Coroutine_USED
27499  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27500  #endif
27501  #ifdef __Pyx_Generator_USED
27502  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27503  #endif
27504  #ifdef __Pyx_AsyncGen_USED
27505  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27506  #endif
27507  #ifdef __Pyx_StopAsyncIteration_USED
27508  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27509  #endif
27510  /*--- Library function declarations ---*/
27511  /*--- Threads initialization code ---*/
27512  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
27513  PyEval_InitThreads();
27514  #endif
27515  /*--- Module creation code ---*/
27516  #if CYTHON_PEP489_MULTI_PHASE_INIT
27517  __pyx_m = __pyx_pyinit_module;
27518  Py_INCREF(__pyx_m);
27519  #else
27520  #if PY_MAJOR_VERSION < 3
27521  __pyx_m = Py_InitModule4("py_c_affine_matrix_function", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
27522  #else
27523  __pyx_m = PyModule_Create(&__pyx_moduledef);
27524  #endif
27525  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27526  #endif
27527  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27528  Py_INCREF(__pyx_d);
27529  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27530  Py_INCREF(__pyx_b);
27531  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27532  Py_INCREF(__pyx_cython_runtime);
27533  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27534  /*--- Initialize various global constants etc. ---*/
27535  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27536  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
27537  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27538  #endif
27539  if (__pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function) {
27540  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27541  }
27542  #if PY_MAJOR_VERSION >= 3
27543  {
27544  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27545  if (!PyDict_GetItemString(modules, "imate._c_linear_operator.py_c_affine_matrix_function")) {
27546  if (unlikely(PyDict_SetItemString(modules, "imate._c_linear_operator.py_c_affine_matrix_function", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
27547  }
27548  }
27549  #endif
27550  /*--- Builtin init code ---*/
27551  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27552  /*--- Constants init code ---*/
27553  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27554  /*--- Global type/function init code ---*/
27555  (void)__Pyx_modinit_global_init_code();
27556  (void)__Pyx_modinit_variable_export_code();
27557  (void)__Pyx_modinit_function_export_code();
27558  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
27559  (void)__Pyx_modinit_type_import_code();
27560  (void)__Pyx_modinit_variable_import_code();
27561  (void)__Pyx_modinit_function_import_code();
27562  /*--- Execution code ---*/
27563  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27564  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27565  #endif
27566  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
27567 
27568  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":15
27569  *
27570  * # Python
27571  * import numpy # <<<<<<<<<<<<<<
27572  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix
27573  *
27574  */
27575  __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
27576  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
27577  __Pyx_GOTREF(__pyx_t_1);
27578  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
27579  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27580 
27581  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":16
27582  * # Python
27583  * import numpy
27584  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix # <<<<<<<<<<<<<<
27585  *
27586  * # Cython
27587  */
27588  __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
27589  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27590  __Pyx_GOTREF(__pyx_t_1);
27591  __Pyx_INCREF(__pyx_n_s_issparse);
27592  __Pyx_GIVEREF(__pyx_n_s_issparse);
27593  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
27594  __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
27595  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
27596  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
27597  __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
27598  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
27599  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
27600  __Pyx_INCREF(__pyx_n_s_csr_matrix);
27601  __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
27602  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
27603  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
27604  __Pyx_GOTREF(__pyx_t_2);
27605  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27606  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27607  __Pyx_GOTREF(__pyx_t_1);
27608  if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27609  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27610  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27611  __Pyx_GOTREF(__pyx_t_1);
27612  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27613  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27614  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27615  __Pyx_GOTREF(__pyx_t_1);
27616  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27617  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27618  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27619  __Pyx_GOTREF(__pyx_t_1);
27620  if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27621  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27622  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27623 
27624  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":306
27625  * # ======================
27626  *
27627  * def set_dense_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27628  * """
27629  * Sets matrix A.
27630  */
27631  __Pyx_TraceLine(306,0,__PYX_ERR(0, 306, __pyx_L1_error))
27632  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
27633  __Pyx_GOTREF(__pyx_t_2);
27634  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
27635  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27636  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27637 
27638  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":402
27639  * # =======================
27640  *
27641  * def set_dense_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27642  * """
27643  * Sets matrix A.
27644  */
27645  __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
27646  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
27647  __Pyx_GOTREF(__pyx_t_2);
27648  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
27649  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27650  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27651 
27652  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":498
27653  * # ============================
27654  *
27655  * def set_dense_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27656  * """
27657  * Sets matrix A.
27658  */
27659  __Pyx_TraceLine(498,0,__PYX_ERR(0, 498, __pyx_L1_error))
27660  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
27661  __Pyx_GOTREF(__pyx_t_2);
27662  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
27663  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27664  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27665 
27666  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":594
27667  * # ====================
27668  *
27669  * def set_csr_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27670  * """
27671  * """
27672  */
27673  __Pyx_TraceLine(594,0,__PYX_ERR(0, 594, __pyx_L1_error))
27674  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
27675  __Pyx_GOTREF(__pyx_t_2);
27676  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 594, __pyx_L1_error)
27677  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27678  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27679 
27680  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":665
27681  * # =====================
27682  *
27683  * def set_csr_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27684  * """
27685  * """
27686  */
27687  __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error))
27688  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
27689  __Pyx_GOTREF(__pyx_t_2);
27690  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
27691  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27692  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27693 
27694  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":736
27695  * # ==========================
27696  *
27697  * def set_csr_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27698  * """
27699  * """
27700  */
27701  __Pyx_TraceLine(736,0,__PYX_ERR(0, 736, __pyx_L1_error))
27702  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
27703  __Pyx_GOTREF(__pyx_t_2);
27704  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
27705  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27706  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27707 
27708  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":807
27709  * # ====================
27710  *
27711  * def set_csc_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27712  * """
27713  * """
27714  */
27715  __Pyx_TraceLine(807,0,__PYX_ERR(0, 807, __pyx_L1_error))
27716  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
27717  __Pyx_GOTREF(__pyx_t_2);
27718  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 807, __pyx_L1_error)
27719  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27720  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27721 
27722  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":878
27723  * # =====================
27724  *
27725  * def set_csc_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27726  * """
27727  * """
27728  */
27729  __Pyx_TraceLine(878,0,__PYX_ERR(0, 878, __pyx_L1_error))
27730  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
27731  __Pyx_GOTREF(__pyx_t_2);
27732  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 878, __pyx_L1_error)
27733  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27734  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27735 
27736  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":949
27737  * # ==========================
27738  *
27739  * def set_csc_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27740  * """
27741  * """
27742  */
27743  __Pyx_TraceLine(949,0,__PYX_ERR(0, 949, __pyx_L1_error))
27744  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error)
27745  __Pyx_GOTREF(__pyx_t_2);
27746  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 949, __pyx_L1_error)
27747  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27748  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27749 
27750  /* "(tree fragment)":1
27751  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
27752  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27753  * def __setstate_cython__(self, __pyx_state):
27754  */
27755  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
27756  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction___reduce, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
27757  __Pyx_GOTREF(__pyx_t_2);
27758  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
27759  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27760 
27761  /* "(tree fragment)":3
27762  * def __reduce_cython__(self):
27763  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27764  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
27765  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27766  */
27767  __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
27768  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction___setsta, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
27769  __Pyx_GOTREF(__pyx_t_2);
27770  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
27771  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27772 
27773  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":1
27774  * # SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu> # <<<<<<<<<<<<<<
27775  * # SPDX-License-Identifier: BSD-3-Clause
27776  * # SPDX-FileType: SOURCE
27777  */
27778  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
27779  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
27780  __Pyx_GOTREF(__pyx_t_2);
27781  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27782  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27783 
27784  /* "View.MemoryView":210
27785  * info.obj = self
27786  *
27787  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
27788  *
27789  * def __dealloc__(array self):
27790  */
27791  __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
27792  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
27793  __Pyx_GOTREF(__pyx_t_2);
27794  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
27795  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27796  PyType_Modified(__pyx_array_type);
27797 
27798  /* "View.MemoryView":227
27799  *
27800  * @cname('get_memview')
27801  * cdef get_memview(self): # <<<<<<<<<<<<<<
27802  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
27803  * return memoryview(self, flags, self.dtype_is_object)
27804  */
27805  __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
27806 
27807 
27808  /* "View.MemoryView":245
27809  *
27810  * @cname("__pyx_array_new")
27811  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
27812  * char *mode, char *buf):
27813  * cdef array result
27814  */
27815  __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
27816 
27817 
27818  /* "View.MemoryView":287
27819  * return self.name
27820  *
27821  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
27822  * cdef strided = Enum("<strided and direct>") # default
27823  * cdef indirect = Enum("<strided and indirect>")
27824  */
27825  __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
27826  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
27827  __Pyx_GOTREF(__pyx_t_2);
27828  __Pyx_XGOTREF(generic);
27829  __Pyx_DECREF_SET(generic, __pyx_t_2);
27830  __Pyx_GIVEREF(__pyx_t_2);
27831  __pyx_t_2 = 0;
27832 
27833  /* "View.MemoryView":288
27834  *
27835  * cdef generic = Enum("<strided and direct or indirect>")
27836  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
27837  * cdef indirect = Enum("<strided and indirect>")
27838  *
27839  */
27840  __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
27841  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
27842  __Pyx_GOTREF(__pyx_t_2);
27843  __Pyx_XGOTREF(strided);
27844  __Pyx_DECREF_SET(strided, __pyx_t_2);
27845  __Pyx_GIVEREF(__pyx_t_2);
27846  __pyx_t_2 = 0;
27847 
27848  /* "View.MemoryView":289
27849  * cdef generic = Enum("<strided and direct or indirect>")
27850  * cdef strided = Enum("<strided and direct>") # default
27851  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
27852  *
27853  *
27854  */
27855  __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
27856  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
27857  __Pyx_GOTREF(__pyx_t_2);
27858  __Pyx_XGOTREF(indirect);
27859  __Pyx_DECREF_SET(indirect, __pyx_t_2);
27860  __Pyx_GIVEREF(__pyx_t_2);
27861  __pyx_t_2 = 0;
27862 
27863  /* "View.MemoryView":292
27864  *
27865  *
27866  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
27867  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27868  *
27869  */
27870  __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
27871  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
27872  __Pyx_GOTREF(__pyx_t_2);
27873  __Pyx_XGOTREF(contiguous);
27874  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
27875  __Pyx_GIVEREF(__pyx_t_2);
27876  __pyx_t_2 = 0;
27877 
27878  /* "View.MemoryView":293
27879  *
27880  * cdef contiguous = Enum("<contiguous and direct>")
27881  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
27882  *
27883  *
27884  */
27885  __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
27886  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error)
27887  __Pyx_GOTREF(__pyx_t_2);
27888  __Pyx_XGOTREF(indirect_contiguous);
27889  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
27890  __Pyx_GIVEREF(__pyx_t_2);
27891  __pyx_t_2 = 0;
27892 
27893  /* "View.MemoryView":299
27894  *
27895  * @cname('__pyx_align_pointer')
27896  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
27897  * "Align pointer memory on a given boundary"
27898  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
27899  */
27900  __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
27901 
27902 
27903  /* "View.MemoryView":317
27904  *
27905  * DEF THREAD_LOCKS_PREALLOCATED = 8
27906  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
27907  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
27908  * PyThread_allocate_lock(),
27909  */
27910  __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
27911  __pyx_memoryview_thread_locks_used = 0;
27912 
27913  /* "View.MemoryView":318
27914  * DEF THREAD_LOCKS_PREALLOCATED = 8
27915  * cdef int __pyx_memoryview_thread_locks_used = 0
27916  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
27917  * PyThread_allocate_lock(),
27918  * PyThread_allocate_lock(),
27919  */
27920  __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
27921  __pyx_t_3[0] = PyThread_allocate_lock();
27922  __pyx_t_3[1] = PyThread_allocate_lock();
27923  __pyx_t_3[2] = PyThread_allocate_lock();
27924  __pyx_t_3[3] = PyThread_allocate_lock();
27925  __pyx_t_3[4] = PyThread_allocate_lock();
27926  __pyx_t_3[5] = PyThread_allocate_lock();
27927  __pyx_t_3[6] = PyThread_allocate_lock();
27928  __pyx_t_3[7] = PyThread_allocate_lock();
27929  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27930 
27931  /* "View.MemoryView":395
27932  * PyThread_free_lock(self.lock)
27933  *
27934  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
27935  * cdef Py_ssize_t dim
27936  * cdef char *itemp = <char *> self.view.buf
27937  */
27938  __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
27939 
27940 
27941  /* "View.MemoryView":433
27942  * self.setitem_indexed(index, value)
27943  *
27944  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
27945  * if not isinstance(obj, memoryview):
27946  * try:
27947  */
27948  __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
27949 
27950 
27951  /* "View.MemoryView":443
27952  * return obj
27953  *
27954  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
27955  * cdef __Pyx_memviewslice dst_slice
27956  * cdef __Pyx_memviewslice src_slice
27957  */
27958  __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
27959 
27960 
27961  /* "View.MemoryView":451
27962  * src.ndim, dst.ndim, self.dtype_is_object)
27963  *
27964  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
27965  * cdef int array[128]
27966  * cdef void *tmp = NULL
27967  */
27968  __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
27969 
27970 
27971  /* "View.MemoryView":483
27972  * PyMem_Free(tmp)
27973  *
27974  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
27975  * cdef char *itemp = self.get_item_pointer(index)
27976  * self.assign_item_from_object(itemp, value)
27977  */
27978  __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
27979 
27980 
27981  /* "View.MemoryView":487
27982  * self.assign_item_from_object(itemp, value)
27983  *
27984  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
27985  * """Only used if instantiated manually by the user, or if Cython doesn't
27986  * know how to convert the type"""
27987  */
27988  __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
27989 
27990 
27991  /* "View.MemoryView":503
27992  * return result
27993  *
27994  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
27995  * """Only used if instantiated manually by the user, or if Cython doesn't
27996  * know how to convert the type"""
27997  */
27998  __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
27999 
28000 
28001  /* "View.MemoryView":551
28002  * info.obj = self
28003  *
28004  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
28005  *
28006  *
28007  */
28008  __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
28009  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
28010  __Pyx_GOTREF(__pyx_t_2);
28011  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
28012  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28013  PyType_Modified(__pyx_memoryview_type);
28014 
28015  /* "View.MemoryView":659
28016  *
28017  * @cname('__pyx_memoryview_new')
28018  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
28019  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
28020  * result.typeinfo = typeinfo
28021  */
28022  __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
28023 
28024 
28025  /* "View.MemoryView":665
28026  *
28027  * @cname('__pyx_memoryview_check')
28028  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
28029  * return isinstance(o, memoryview)
28030  *
28031  */
28032  __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
28033 
28034 
28035  /* "View.MemoryView":668
28036  * return isinstance(o, memoryview)
28037  *
28038  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
28039  * """
28040  * Replace all ellipses with full slices and fill incomplete indices with
28041  */
28042  __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
28043 
28044 
28045  /* "View.MemoryView":702
28046  * return have_slices or nslices, tuple(result)
28047  *
28048  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
28049  * for suboffset in suboffsets[:ndim]:
28050  * if suboffset >= 0:
28051  */
28052  __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
28053 
28054 
28055  /* "View.MemoryView":712
28056  *
28057  * @cname('__pyx_memview_slice')
28058  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
28059  * cdef int new_ndim = 0, suboffset_dim = -1, dim
28060  * cdef bint negative_step
28061  */
28062  __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
28063 
28064 
28065  /* "View.MemoryView":809
28066  *
28067  * @cname('__pyx_memoryview_slice_memviewslice')
28068  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
28069  * __Pyx_memviewslice *dst,
28070  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
28071  */
28072  __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
28073 
28074 
28075  /* "View.MemoryView":912
28076  *
28077  * @cname('__pyx_pybuffer_index')
28078  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
28079  * Py_ssize_t dim) except NULL:
28080  * cdef Py_ssize_t shape, stride, suboffset = -1
28081  */
28082  __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
28083 
28084 
28085  /* "View.MemoryView":945
28086  *
28087  * @cname('__pyx_memslice_transpose')
28088  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
28089  * cdef int ndim = memslice.memview.view.ndim
28090  *
28091  */
28092  __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
28093 
28094 
28095  /* "View.MemoryView":981
28096  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
28097  *
28098  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
28099  * if self.to_object_func != NULL:
28100  * return self.to_object_func(itemp)
28101  */
28102  __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
28103 
28104 
28105  /* "View.MemoryView":987
28106  * return memoryview.convert_item_to_object(self, itemp)
28107  *
28108  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
28109  * if self.to_dtype_func != NULL:
28110  * self.to_dtype_func(itemp, value)
28111  */
28112  __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
28113 
28114 
28115  /* "View.MemoryView":997
28116  * return self.from_object
28117  *
28118  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
28119  *
28120  *
28121  */
28122  __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
28123  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
28124  __Pyx_GOTREF(__pyx_t_2);
28125  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
28126  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28127  PyType_Modified(__pyx_memoryviewslice_type);
28128 
28129  /* "View.MemoryView":1001
28130  *
28131  * @cname('__pyx_memoryview_fromslice')
28132  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
28133  * int ndim,
28134  * object (*to_object_func)(char *),
28135  */
28136  __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
28137 
28138 
28139  /* "View.MemoryView":1054
28140  *
28141  * @cname('__pyx_memoryview_get_slice_from_memoryview')
28142  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
28143  * __Pyx_memviewslice *mslice) except NULL:
28144  * cdef _memoryviewslice obj
28145  */
28146  __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
28147 
28148 
28149  /* "View.MemoryView":1065
28150  *
28151  * @cname('__pyx_memoryview_slice_copy')
28152  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
28153  * cdef int dim
28154  * cdef (Py_ssize_t*) shape, strides, suboffsets
28155  */
28156  __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
28157 
28158 
28159  /* "View.MemoryView":1082
28160  *
28161  * @cname('__pyx_memoryview_copy_object')
28162  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
28163  * "Create a new memoryview object"
28164  * cdef __Pyx_memviewslice memviewslice
28165  */
28166  __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
28167 
28168 
28169  /* "View.MemoryView":1089
28170  *
28171  * @cname('__pyx_memoryview_copy_object_from_slice')
28172  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
28173  * """
28174  * Create a new memoryview object from a given memoryview object and slice.
28175  */
28176  __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
28177 
28178 
28179  /* "View.MemoryView":1111
28180  *
28181  *
28182  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
28183  * if arg < 0:
28184  * return -arg
28185  */
28186  __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
28187 
28188 
28189  /* "View.MemoryView":1118
28190  *
28191  * @cname('__pyx_get_best_slice_order')
28192  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
28193  * """
28194  * Figure out the best memory access order for a given slice.
28195  */
28196  __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
28197 
28198 
28199  /* "View.MemoryView":1172
28200  * dst_data += dst_stride
28201  *
28202  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
28203  * __Pyx_memviewslice *dst,
28204  * int ndim, size_t itemsize) nogil:
28205  */
28206  __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
28207 
28208 
28209  /* "View.MemoryView":1179
28210  *
28211  * @cname('__pyx_memoryview_slice_get_size')
28212  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
28213  * "Return the size of the memory occupied by the slice in number of bytes"
28214  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
28215  */
28216  __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
28217 
28218 
28219  /* "View.MemoryView":1189
28220  *
28221  * @cname('__pyx_fill_contig_strides_array')
28222  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
28223  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
28224  * int ndim, char order) nogil:
28225  */
28226  __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
28227 
28228 
28229  /* "View.MemoryView":1210
28230  *
28231  * @cname('__pyx_memoryview_copy_data_to_temp')
28232  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
28233  * __Pyx_memviewslice *tmpslice,
28234  * char order,
28235  */
28236  __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
28237 
28238 
28239  /* "View.MemoryView":1253
28240  *
28241  * @cname('__pyx_memoryview_err_extents')
28242  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
28243  * Py_ssize_t extent2) except -1 with gil:
28244  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
28245  */
28246  __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
28247 
28248 
28249  /* "View.MemoryView":1259
28250  *
28251  * @cname('__pyx_memoryview_err_dim')
28252  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
28253  * raise error(msg.decode('ascii') % dim)
28254  *
28255  */
28256  __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
28257 
28258 
28259  /* "View.MemoryView":1263
28260  *
28261  * @cname('__pyx_memoryview_err')
28262  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
28263  * if msg != NULL:
28264  * raise error(msg.decode('ascii'))
28265  */
28266  __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
28267 
28268 
28269  /* "View.MemoryView":1270
28270  *
28271  * @cname('__pyx_memoryview_copy_contents')
28272  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
28273  * __Pyx_memviewslice dst,
28274  * int src_ndim, int dst_ndim,
28275  */
28276  __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
28277 
28278 
28279  /* "View.MemoryView":1342
28280  *
28281  * @cname('__pyx_memoryview_broadcast_leading')
28282  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
28283  * int ndim,
28284  * int ndim_other) nogil:
28285  */
28286  __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
28287 
28288 
28289  /* "View.MemoryView":1364
28290  *
28291  * @cname('__pyx_memoryview_refcount_copying')
28292  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
28293  * int ndim, bint inc) nogil:
28294  *
28295  */
28296  __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
28297 
28298 
28299  /* "View.MemoryView":1373
28300  *
28301  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
28302  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
28303  * Py_ssize_t *strides, int ndim,
28304  * bint inc) with gil:
28305  */
28306  __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
28307 
28308 
28309  /* "View.MemoryView":1379
28310  *
28311  * @cname('__pyx_memoryview_refcount_objects_in_slice')
28312  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
28313  * Py_ssize_t *strides, int ndim, bint inc):
28314  * cdef Py_ssize_t i
28315  */
28316  __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
28317 
28318 
28319  /* "View.MemoryView":1399
28320  *
28321  * @cname('__pyx_memoryview_slice_assign_scalar')
28322  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
28323  * size_t itemsize, void *item,
28324  * bint dtype_is_object) nogil:
28325  */
28326  __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
28327 
28328 
28329  /* "View.MemoryView":1409
28330  *
28331  * @cname('__pyx_memoryview__slice_assign_scalar')
28332  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
28333  * Py_ssize_t *strides, int ndim,
28334  * size_t itemsize, void *item) nogil:
28335  */
28336  __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
28337 
28338 
28339  /* "(tree fragment)":1
28340  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
28341  * cdef object __pyx_PickleError
28342  * cdef object __pyx_result
28343  */
28344  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
28345  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
28346  __Pyx_GOTREF(__pyx_t_2);
28347  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
28348  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28349 
28350  /* "(tree fragment)":11
28351  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
28352  * return __pyx_result
28353  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
28354  * __pyx_result.name = __pyx_state[0]
28355  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
28356  */
28357  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
28358 
28359  __Pyx_TraceReturn(Py_None, 0);
28360 
28361  /*--- Wrapped vars code ---*/
28362 
28363  goto __pyx_L0;
28364  __pyx_L1_error:;
28365  __Pyx_XDECREF(__pyx_t_1);
28366  __Pyx_XDECREF(__pyx_t_2);
28367  if (__pyx_m) {
28368  if (__pyx_d) {
28369  __Pyx_AddTraceback("init imate._c_linear_operator.py_c_affine_matrix_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
28370  }
28371  Py_CLEAR(__pyx_m);
28372  } else if (!PyErr_Occurred()) {
28373  PyErr_SetString(PyExc_ImportError, "init imate._c_linear_operator.py_c_affine_matrix_function");
28374  }
28375  __pyx_L0:;
28376  __Pyx_RefNannyFinishContext();
28377  #if CYTHON_PEP489_MULTI_PHASE_INIT
28378  return (__pyx_m != NULL) ? 0 : -1;
28379  #elif PY_MAJOR_VERSION >= 3
28380  return __pyx_m;
28381  #else
28382  return;
28383  #endif
28384 }
28385 
28386 /* --- Runtime support code --- */
28387 /* Refnanny */
28388 #if CYTHON_REFNANNY
28389 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
28390  PyObject *m = NULL, *p = NULL;
28391  void *r = NULL;
28392  m = PyImport_ImportModule(modname);
28393  if (!m) goto end;
28394  p = PyObject_GetAttrString(m, "RefNannyAPI");
28395  if (!p) goto end;
28396  r = PyLong_AsVoidPtr(p);
28397 end:
28398  Py_XDECREF(p);
28399  Py_XDECREF(m);
28400  return (__Pyx_RefNannyAPIStruct *)r;
28401 }
28402 #endif
28403 
28404 /* PyObjectGetAttrStr */
28405 #if CYTHON_USE_TYPE_SLOTS
28406 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28407  PyTypeObject* tp = Py_TYPE(obj);
28408  if (likely(tp->tp_getattro))
28409  return tp->tp_getattro(obj, attr_name);
28410 #if PY_MAJOR_VERSION < 3
28411  if (likely(tp->tp_getattr))
28412  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28413 #endif
28414  return PyObject_GetAttr(obj, attr_name);
28415 }
28416 #endif
28417 
28418 /* GetBuiltinName */
28419 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28420  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
28421  if (unlikely(!result)) {
28422  PyErr_Format(PyExc_NameError,
28423 #if PY_MAJOR_VERSION >= 3
28424  "name '%U' is not defined", name);
28425 #else
28426  "name '%.200s' is not defined", PyString_AS_STRING(name));
28427 #endif
28428  }
28429  return result;
28430 }
28431 
28432 /* RaiseDoubleKeywords */
28433 static void __Pyx_RaiseDoubleKeywordsError(
28434  const char* func_name,
28435  PyObject* kw_name)
28436 {
28437  PyErr_Format(PyExc_TypeError,
28438  #if PY_MAJOR_VERSION >= 3
28439  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28440  #else
28441  "%s() got multiple values for keyword argument '%s'", func_name,
28442  PyString_AsString(kw_name));
28443  #endif
28444 }
28445 
28446 /* ParseKeywords */
28447 static int __Pyx_ParseOptionalKeywords(
28448  PyObject *kwds,
28449  PyObject **argnames[],
28450  PyObject *kwds2,
28451  PyObject *values[],
28452  Py_ssize_t num_pos_args,
28453  const char* function_name)
28454 {
28455  PyObject *key = 0, *value = 0;
28456  Py_ssize_t pos = 0;
28457  PyObject*** name;
28458  PyObject*** first_kw_arg = argnames + num_pos_args;
28459  while (PyDict_Next(kwds, &pos, &key, &value)) {
28460  name = first_kw_arg;
28461  while (*name && (**name != key)) name++;
28462  if (*name) {
28463  values[name-argnames] = value;
28464  continue;
28465  }
28466  name = first_kw_arg;
28467  #if PY_MAJOR_VERSION < 3
28468  if (likely(PyString_Check(key))) {
28469  while (*name) {
28470  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
28471  && _PyString_Eq(**name, key)) {
28472  values[name-argnames] = value;
28473  break;
28474  }
28475  name++;
28476  }
28477  if (*name) continue;
28478  else {
28479  PyObject*** argname = argnames;
28480  while (argname != first_kw_arg) {
28481  if ((**argname == key) || (
28482  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
28483  && _PyString_Eq(**argname, key))) {
28484  goto arg_passed_twice;
28485  }
28486  argname++;
28487  }
28488  }
28489  } else
28490  #endif
28491  if (likely(PyUnicode_Check(key))) {
28492  while (*name) {
28493  int cmp = (**name == key) ? 0 :
28494  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28495  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28496  #endif
28497  PyUnicode_Compare(**name, key);
28498  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28499  if (cmp == 0) {
28500  values[name-argnames] = value;
28501  break;
28502  }
28503  name++;
28504  }
28505  if (*name) continue;
28506  else {
28507  PyObject*** argname = argnames;
28508  while (argname != first_kw_arg) {
28509  int cmp = (**argname == key) ? 0 :
28510  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28511  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28512  #endif
28513  PyUnicode_Compare(**argname, key);
28514  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28515  if (cmp == 0) goto arg_passed_twice;
28516  argname++;
28517  }
28518  }
28519  } else
28520  goto invalid_keyword_type;
28521  if (kwds2) {
28522  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
28523  } else {
28524  goto invalid_keyword;
28525  }
28526  }
28527  return 0;
28528 arg_passed_twice:
28529  __Pyx_RaiseDoubleKeywordsError(function_name, key);
28530  goto bad;
28531 invalid_keyword_type:
28532  PyErr_Format(PyExc_TypeError,
28533  "%.200s() keywords must be strings", function_name);
28534  goto bad;
28535 invalid_keyword:
28536  PyErr_Format(PyExc_TypeError,
28537  #if PY_MAJOR_VERSION < 3
28538  "%.200s() got an unexpected keyword argument '%.200s'",
28539  function_name, PyString_AsString(key));
28540  #else
28541  "%s() got an unexpected keyword argument '%U'",
28542  function_name, key);
28543  #endif
28544 bad:
28545  return -1;
28546 }
28547 
28548 /* RaiseArgTupleInvalid */
28549 static void __Pyx_RaiseArgtupleInvalid(
28550  const char* func_name,
28551  int exact,
28552  Py_ssize_t num_min,
28553  Py_ssize_t num_max,
28554  Py_ssize_t num_found)
28555 {
28556  Py_ssize_t num_expected;
28557  const char *more_or_less;
28558  if (num_found < num_min) {
28559  num_expected = num_min;
28560  more_or_less = "at least";
28561  } else {
28562  num_expected = num_max;
28563  more_or_less = "at most";
28564  }
28565  if (exact) {
28566  more_or_less = "exactly";
28567  }
28568  PyErr_Format(PyExc_TypeError,
28569  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
28570  func_name, more_or_less, num_expected,
28571  (num_expected == 1) ? "" : "s", num_found);
28572 }
28573 
28574 /* PyErrFetchRestore */
28575 #if CYTHON_FAST_THREAD_STATE
28576 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28577  PyObject *tmp_type, *tmp_value, *tmp_tb;
28578  tmp_type = tstate->curexc_type;
28579  tmp_value = tstate->curexc_value;
28580  tmp_tb = tstate->curexc_traceback;
28581  tstate->curexc_type = type;
28582  tstate->curexc_value = value;
28583  tstate->curexc_traceback = tb;
28584  Py_XDECREF(tmp_type);
28585  Py_XDECREF(tmp_value);
28586  Py_XDECREF(tmp_tb);
28587 }
28588 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28589  *type = tstate->curexc_type;
28590  *value = tstate->curexc_value;
28591  *tb = tstate->curexc_traceback;
28592  tstate->curexc_type = 0;
28593  tstate->curexc_value = 0;
28594  tstate->curexc_traceback = 0;
28595 }
28596 #endif
28597 
28598 /* Profile */
28599 #if CYTHON_PROFILE
28600 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
28601  PyFrameObject** frame,
28602  PyThreadState* tstate,
28603  const char *funcname,
28604  const char *srcfile,
28605  int firstlineno) {
28606  PyObject *type, *value, *traceback;
28607  int retval;
28608  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
28609  if (*code == NULL) {
28610  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
28611  if (*code == NULL) return 0;
28612  }
28613  *frame = PyFrame_New(
28614  tstate, /*PyThreadState *tstate*/
28615  *code, /*PyCodeObject *code*/
28616  __pyx_d, /*PyObject *globals*/
28617  0 /*PyObject *locals*/
28618  );
28619  if (*frame == NULL) return 0;
28620  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
28621  Py_INCREF(Py_None);
28622  (*frame)->f_trace = Py_None;
28623  }
28624 #if PY_VERSION_HEX < 0x030400B1
28625  } else {
28626  (*frame)->f_tstate = tstate;
28627 #endif
28628  }
28629  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
28630  retval = 1;
28631  __Pyx_EnterTracing(tstate);
28632  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
28633  #if CYTHON_TRACE
28634  if (tstate->c_tracefunc)
28635  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
28636  if (retval && tstate->c_profilefunc)
28637  #endif
28638  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
28639  __Pyx_LeaveTracing(tstate);
28640  if (retval) {
28641  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
28642  return __Pyx_IsTracing(tstate, 0, 0) && retval;
28643  } else {
28644  Py_XDECREF(type);
28645  Py_XDECREF(value);
28646  Py_XDECREF(traceback);
28647  return -1;
28648  }
28649 }
28650 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
28651  PyCodeObject *py_code = 0;
28652 #if PY_MAJOR_VERSION >= 3
28653  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
28654  if (likely(py_code)) {
28655  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
28656  }
28657 #else
28658  PyObject *py_srcfile = 0;
28659  PyObject *py_funcname = 0;
28660  py_funcname = PyString_FromString(funcname);
28661  if (unlikely(!py_funcname)) goto bad;
28662  py_srcfile = PyString_FromString(srcfile);
28663  if (unlikely(!py_srcfile)) goto bad;
28664  py_code = PyCode_New(
28665  0,
28666  0,
28667  0,
28668  CO_OPTIMIZED | CO_NEWLOCALS,
28669  __pyx_empty_bytes, /*PyObject *code,*/
28670  __pyx_empty_tuple, /*PyObject *consts,*/
28671  __pyx_empty_tuple, /*PyObject *names,*/
28672  __pyx_empty_tuple, /*PyObject *varnames,*/
28673  __pyx_empty_tuple, /*PyObject *freevars,*/
28674  __pyx_empty_tuple, /*PyObject *cellvars,*/
28675  py_srcfile, /*PyObject *filename,*/
28676  py_funcname, /*PyObject *name,*/
28677  firstlineno,
28678  __pyx_empty_bytes /*PyObject *lnotab*/
28679  );
28680 bad:
28681  Py_XDECREF(py_srcfile);
28682  Py_XDECREF(py_funcname);
28683 #endif
28684  return py_code;
28685 }
28686 #endif
28687 
28688 /* PyObjectCall */
28689 #if CYTHON_COMPILING_IN_CPYTHON
28690 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28691  PyObject *result;
28692  ternaryfunc call = Py_TYPE(func)->tp_call;
28693  if (unlikely(!call))
28694  return PyObject_Call(func, arg, kw);
28695  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28696  return NULL;
28697  result = (*call)(func, arg, kw);
28698  Py_LeaveRecursiveCall();
28699  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28700  PyErr_SetString(
28701  PyExc_SystemError,
28702  "NULL result without error in PyObject_Call");
28703  }
28704  return result;
28705 }
28706 #endif
28707 
28708 /* RaiseException */
28709 #if PY_MAJOR_VERSION < 3
28710 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
28711  CYTHON_UNUSED PyObject *cause) {
28712  __Pyx_PyThreadState_declare
28713  Py_XINCREF(type);
28714  if (!value || value == Py_None)
28715  value = NULL;
28716  else
28717  Py_INCREF(value);
28718  if (!tb || tb == Py_None)
28719  tb = NULL;
28720  else {
28721  Py_INCREF(tb);
28722  if (!PyTraceBack_Check(tb)) {
28723  PyErr_SetString(PyExc_TypeError,
28724  "raise: arg 3 must be a traceback or None");
28725  goto raise_error;
28726  }
28727  }
28728  if (PyType_Check(type)) {
28729 #if CYTHON_COMPILING_IN_PYPY
28730  if (!value) {
28731  Py_INCREF(Py_None);
28732  value = Py_None;
28733  }
28734 #endif
28735  PyErr_NormalizeException(&type, &value, &tb);
28736  } else {
28737  if (value) {
28738  PyErr_SetString(PyExc_TypeError,
28739  "instance exception may not have a separate value");
28740  goto raise_error;
28741  }
28742  value = type;
28743  type = (PyObject*) Py_TYPE(type);
28744  Py_INCREF(type);
28745  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
28746  PyErr_SetString(PyExc_TypeError,
28747  "raise: exception class must be a subclass of BaseException");
28748  goto raise_error;
28749  }
28750  }
28751  __Pyx_PyThreadState_assign
28752  __Pyx_ErrRestore(type, value, tb);
28753  return;
28754 raise_error:
28755  Py_XDECREF(value);
28756  Py_XDECREF(type);
28757  Py_XDECREF(tb);
28758  return;
28759 }
28760 #else
28761 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28762  PyObject* owned_instance = NULL;
28763  if (tb == Py_None) {
28764  tb = 0;
28765  } else if (tb && !PyTraceBack_Check(tb)) {
28766  PyErr_SetString(PyExc_TypeError,
28767  "raise: arg 3 must be a traceback or None");
28768  goto bad;
28769  }
28770  if (value == Py_None)
28771  value = 0;
28772  if (PyExceptionInstance_Check(type)) {
28773  if (value) {
28774  PyErr_SetString(PyExc_TypeError,
28775  "instance exception may not have a separate value");
28776  goto bad;
28777  }
28778  value = type;
28779  type = (PyObject*) Py_TYPE(value);
28780  } else if (PyExceptionClass_Check(type)) {
28781  PyObject *instance_class = NULL;
28782  if (value && PyExceptionInstance_Check(value)) {
28783  instance_class = (PyObject*) Py_TYPE(value);
28784  if (instance_class != type) {
28785  int is_subclass = PyObject_IsSubclass(instance_class, type);
28786  if (!is_subclass) {
28787  instance_class = NULL;
28788  } else if (unlikely(is_subclass == -1)) {
28789  goto bad;
28790  } else {
28791  type = instance_class;
28792  }
28793  }
28794  }
28795  if (!instance_class) {
28796  PyObject *args;
28797  if (!value)
28798  args = PyTuple_New(0);
28799  else if (PyTuple_Check(value)) {
28800  Py_INCREF(value);
28801  args = value;
28802  } else
28803  args = PyTuple_Pack(1, value);
28804  if (!args)
28805  goto bad;
28806  owned_instance = PyObject_Call(type, args, NULL);
28807  Py_DECREF(args);
28808  if (!owned_instance)
28809  goto bad;
28810  value = owned_instance;
28811  if (!PyExceptionInstance_Check(value)) {
28812  PyErr_Format(PyExc_TypeError,
28813  "calling %R should have returned an instance of "
28814  "BaseException, not %R",
28815  type, Py_TYPE(value));
28816  goto bad;
28817  }
28818  }
28819  } else {
28820  PyErr_SetString(PyExc_TypeError,
28821  "raise: exception class must be a subclass of BaseException");
28822  goto bad;
28823  }
28824  if (cause) {
28825  PyObject *fixed_cause;
28826  if (cause == Py_None) {
28827  fixed_cause = NULL;
28828  } else if (PyExceptionClass_Check(cause)) {
28829  fixed_cause = PyObject_CallObject(cause, NULL);
28830  if (fixed_cause == NULL)
28831  goto bad;
28832  } else if (PyExceptionInstance_Check(cause)) {
28833  fixed_cause = cause;
28834  Py_INCREF(fixed_cause);
28835  } else {
28836  PyErr_SetString(PyExc_TypeError,
28837  "exception causes must derive from "
28838  "BaseException");
28839  goto bad;
28840  }
28841  PyException_SetCause(value, fixed_cause);
28842  }
28843  PyErr_SetObject(type, value);
28844  if (tb) {
28845 #if CYTHON_FAST_THREAD_STATE
28846  PyThreadState *tstate = __Pyx_PyThreadState_Current;
28847  PyObject* tmp_tb = tstate->curexc_traceback;
28848  if (tb != tmp_tb) {
28849  Py_INCREF(tb);
28850  tstate->curexc_traceback = tb;
28851  Py_XDECREF(tmp_tb);
28852  }
28853 #else
28854  PyObject *tmp_type, *tmp_value, *tmp_tb;
28855  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
28856  Py_INCREF(tb);
28857  PyErr_Restore(tmp_type, tmp_value, tb);
28858  Py_XDECREF(tmp_tb);
28859 #endif
28860  }
28861 bad:
28862  Py_XDECREF(owned_instance);
28863  return;
28864 }
28865 #endif
28866 
28867 /* PyIntCompare */
28868 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
28869  if (op1 == op2) {
28870  Py_RETURN_FALSE;
28871  }
28872  #if PY_MAJOR_VERSION < 3
28873  if (likely(PyInt_CheckExact(op1))) {
28874  const long b = intval;
28875  long a = PyInt_AS_LONG(op1);
28876  if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
28877  }
28878  #endif
28879  #if CYTHON_USE_PYLONG_INTERNALS
28880  if (likely(PyLong_CheckExact(op1))) {
28881  int unequal;
28882  unsigned long uintval;
28883  Py_ssize_t size = Py_SIZE(op1);
28884  const digit* digits = ((PyLongObject*)op1)->ob_digit;
28885  if (intval == 0) {
28886  if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
28887  } else if (intval < 0) {
28888  if (size >= 0)
28889  Py_RETURN_TRUE;
28890  intval = -intval;
28891  size = -size;
28892  } else {
28893  if (size <= 0)
28894  Py_RETURN_TRUE;
28895  }
28896  uintval = (unsigned long) intval;
28897 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
28898  if (uintval >> (PyLong_SHIFT * 4)) {
28899  unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
28900  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
28901  } else
28902 #endif
28903 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
28904  if (uintval >> (PyLong_SHIFT * 3)) {
28905  unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
28906  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
28907  } else
28908 #endif
28909 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
28910  if (uintval >> (PyLong_SHIFT * 2)) {
28911  unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
28912  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
28913  } else
28914 #endif
28915 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
28916  if (uintval >> (PyLong_SHIFT * 1)) {
28917  unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
28918  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
28919  } else
28920 #endif
28921  unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
28922  if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
28923  }
28924  #endif
28925  if (PyFloat_CheckExact(op1)) {
28926  const long b = intval;
28927  double a = PyFloat_AS_DOUBLE(op1);
28928  if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
28929  }
28930  return (
28931  PyObject_RichCompare(op1, op2, Py_NE));
28932 }
28933 
28934 /* BytesEquals */
28935 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
28936 #if CYTHON_COMPILING_IN_PYPY
28937  return PyObject_RichCompareBool(s1, s2, equals);
28938 #else
28939  if (s1 == s2) {
28940  return (equals == Py_EQ);
28941  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
28942  const char *ps1, *ps2;
28943  Py_ssize_t length = PyBytes_GET_SIZE(s1);
28944  if (length != PyBytes_GET_SIZE(s2))
28945  return (equals == Py_NE);
28946  ps1 = PyBytes_AS_STRING(s1);
28947  ps2 = PyBytes_AS_STRING(s2);
28948  if (ps1[0] != ps2[0]) {
28949  return (equals == Py_NE);
28950  } else if (length == 1) {
28951  return (equals == Py_EQ);
28952  } else {
28953  int result;
28954 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
28955  Py_hash_t hash1, hash2;
28956  hash1 = ((PyBytesObject*)s1)->ob_shash;
28957  hash2 = ((PyBytesObject*)s2)->ob_shash;
28958  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28959  return (equals == Py_NE);
28960  }
28961 #endif
28962  result = memcmp(ps1, ps2, (size_t)length);
28963  return (equals == Py_EQ) ? (result == 0) : (result != 0);
28964  }
28965  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
28966  return (equals == Py_NE);
28967  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
28968  return (equals == Py_NE);
28969  } else {
28970  int result;
28971  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28972  if (!py_result)
28973  return -1;
28974  result = __Pyx_PyObject_IsTrue(py_result);
28975  Py_DECREF(py_result);
28976  return result;
28977  }
28978 #endif
28979 }
28980 
28981 /* PyDictVersioning */
28982 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
28983 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
28984  PyObject *dict = Py_TYPE(obj)->tp_dict;
28985  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
28986 }
28987 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
28988  PyObject **dictptr = NULL;
28989  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
28990  if (offset) {
28991 #if CYTHON_COMPILING_IN_CPYTHON
28992  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
28993 #else
28994  dictptr = _PyObject_GetDictPtr(obj);
28995 #endif
28996  }
28997  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
28998 }
28999 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
29000  PyObject *dict = Py_TYPE(obj)->tp_dict;
29001  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
29002  return 0;
29003  return obj_dict_version == __Pyx_get_object_dict_version(obj);
29004 }
29005 #endif
29006 
29007 /* GetModuleGlobalName */
29008 #if CYTHON_USE_DICT_VERSIONS
29009 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
29010 #else
29011 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
29012 #endif
29013 {
29014  PyObject *result;
29015 #if !CYTHON_AVOID_BORROWED_REFS
29016 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
29017  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
29018  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29019  if (likely(result)) {
29020  return __Pyx_NewRef(result);
29021  } else if (unlikely(PyErr_Occurred())) {
29022  return NULL;
29023  }
29024 #else
29025  result = PyDict_GetItem(__pyx_d, name);
29026  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29027  if (likely(result)) {
29028  return __Pyx_NewRef(result);
29029  }
29030 #endif
29031 #else
29032  result = PyObject_GetItem(__pyx_d, name);
29033  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29034  if (likely(result)) {
29035  return __Pyx_NewRef(result);
29036  }
29037  PyErr_Clear();
29038 #endif
29039  return __Pyx_GetBuiltinName(name);
29040 }
29041 
29042 /* PyCFunctionFastCall */
29043 #if CYTHON_FAST_PYCCALL
29044 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
29045  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
29046  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
29047  PyObject *self = PyCFunction_GET_SELF(func);
29048  int flags = PyCFunction_GET_FLAGS(func);
29049  assert(PyCFunction_Check(func));
29050  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
29051  assert(nargs >= 0);
29052  assert(nargs == 0 || args != NULL);
29053  /* _PyCFunction_FastCallDict() must not be called with an exception set,
29054  because it may clear it (directly or indirectly) and so the
29055  caller loses its exception */
29056  assert(!PyErr_Occurred());
29057  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
29058  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
29059  } else {
29060  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
29061  }
29062 }
29063 #endif
29064 
29065 /* PyFunctionFastCall */
29066 #if CYTHON_FAST_PYCALL
29067 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
29068  PyObject *globals) {
29069  PyFrameObject *f;
29070  PyThreadState *tstate = __Pyx_PyThreadState_Current;
29071  PyObject **fastlocals;
29072  Py_ssize_t i;
29073  PyObject *result;
29074  assert(globals != NULL);
29075  /* XXX Perhaps we should create a specialized
29076  PyFrame_New() that doesn't take locals, but does
29077  take builtins without sanity checking them.
29078  */
29079  assert(tstate != NULL);
29080  f = PyFrame_New(tstate, co, globals, NULL);
29081  if (f == NULL) {
29082  return NULL;
29083  }
29084  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
29085  for (i = 0; i < na; i++) {
29086  Py_INCREF(*args);
29087  fastlocals[i] = *args++;
29088  }
29089  result = PyEval_EvalFrameEx(f,0);
29090  ++tstate->recursion_depth;
29091  Py_DECREF(f);
29092  --tstate->recursion_depth;
29093  return result;
29094 }
29095 #if 1 || PY_VERSION_HEX < 0x030600B1
29096 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
29097  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
29098  PyObject *globals = PyFunction_GET_GLOBALS(func);
29099  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
29100  PyObject *closure;
29101 #if PY_MAJOR_VERSION >= 3
29102  PyObject *kwdefs;
29103 #endif
29104  PyObject *kwtuple, **k;
29105  PyObject **d;
29106  Py_ssize_t nd;
29107  Py_ssize_t nk;
29108  PyObject *result;
29109  assert(kwargs == NULL || PyDict_Check(kwargs));
29110  nk = kwargs ? PyDict_Size(kwargs) : 0;
29111  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
29112  return NULL;
29113  }
29114  if (
29115 #if PY_MAJOR_VERSION >= 3
29116  co->co_kwonlyargcount == 0 &&
29117 #endif
29118  likely(kwargs == NULL || nk == 0) &&
29119  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
29120  if (argdefs == NULL && co->co_argcount == nargs) {
29121  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
29122  goto done;
29123  }
29124  else if (nargs == 0 && argdefs != NULL
29125  && co->co_argcount == Py_SIZE(argdefs)) {
29126  /* function called with no arguments, but all parameters have
29127  a default value: use default values as arguments .*/
29128  args = &PyTuple_GET_ITEM(argdefs, 0);
29129  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
29130  goto done;
29131  }
29132  }
29133  if (kwargs != NULL) {
29134  Py_ssize_t pos, i;
29135  kwtuple = PyTuple_New(2 * nk);
29136  if (kwtuple == NULL) {
29137  result = NULL;
29138  goto done;
29139  }
29140  k = &PyTuple_GET_ITEM(kwtuple, 0);
29141  pos = i = 0;
29142  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
29143  Py_INCREF(k[i]);
29144  Py_INCREF(k[i+1]);
29145  i += 2;
29146  }
29147  nk = i / 2;
29148  }
29149  else {
29150  kwtuple = NULL;
29151  k = NULL;
29152  }
29153  closure = PyFunction_GET_CLOSURE(func);
29154 #if PY_MAJOR_VERSION >= 3
29155  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
29156 #endif
29157  if (argdefs != NULL) {
29158  d = &PyTuple_GET_ITEM(argdefs, 0);
29159  nd = Py_SIZE(argdefs);
29160  }
29161  else {
29162  d = NULL;
29163  nd = 0;
29164  }
29165 #if PY_MAJOR_VERSION >= 3
29166  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
29167  args, (int)nargs,
29168  k, (int)nk,
29169  d, (int)nd, kwdefs, closure);
29170 #else
29171  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
29172  args, (int)nargs,
29173  k, (int)nk,
29174  d, (int)nd, closure);
29175 #endif
29176  Py_XDECREF(kwtuple);
29177 done:
29178  Py_LeaveRecursiveCall();
29179  return result;
29180 }
29181 #endif
29182 #endif
29183 
29184 /* PyObjectCall2Args */
29185 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
29186  PyObject *args, *result = NULL;
29187  #if CYTHON_FAST_PYCALL
29188  if (PyFunction_Check(function)) {
29189  PyObject *args[2] = {arg1, arg2};
29190  return __Pyx_PyFunction_FastCall(function, args, 2);
29191  }
29192  #endif
29193  #if CYTHON_FAST_PYCCALL
29194  if (__Pyx_PyFastCFunction_Check(function)) {
29195  PyObject *args[2] = {arg1, arg2};
29196  return __Pyx_PyCFunction_FastCall(function, args, 2);
29197  }
29198  #endif
29199  args = PyTuple_New(2);
29200  if (unlikely(!args)) goto done;
29201  Py_INCREF(arg1);
29202  PyTuple_SET_ITEM(args, 0, arg1);
29203  Py_INCREF(arg2);
29204  PyTuple_SET_ITEM(args, 1, arg2);
29205  Py_INCREF(function);
29206  result = __Pyx_PyObject_Call(function, args, NULL);
29207  Py_DECREF(args);
29208  Py_DECREF(function);
29209 done:
29210  return result;
29211 }
29212 
29213 /* PyObjectCallMethO */
29214 #if CYTHON_COMPILING_IN_CPYTHON
29215 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
29216  PyObject *self, *result;
29217  PyCFunction cfunc;
29218  cfunc = PyCFunction_GET_FUNCTION(func);
29219  self = PyCFunction_GET_SELF(func);
29220  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
29221  return NULL;
29222  result = cfunc(self, arg);
29223  Py_LeaveRecursiveCall();
29224  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29225  PyErr_SetString(
29226  PyExc_SystemError,
29227  "NULL result without error in PyObject_Call");
29228  }
29229  return result;
29230 }
29231 #endif
29232 
29233 /* PyObjectCallOneArg */
29234 #if CYTHON_COMPILING_IN_CPYTHON
29235 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29236  PyObject *result;
29237  PyObject *args = PyTuple_New(1);
29238  if (unlikely(!args)) return NULL;
29239  Py_INCREF(arg);
29240  PyTuple_SET_ITEM(args, 0, arg);
29241  result = __Pyx_PyObject_Call(func, args, NULL);
29242  Py_DECREF(args);
29243  return result;
29244 }
29245 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29246 #if CYTHON_FAST_PYCALL
29247  if (PyFunction_Check(func)) {
29248  return __Pyx_PyFunction_FastCall(func, &arg, 1);
29249  }
29250 #endif
29251  if (likely(PyCFunction_Check(func))) {
29252  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
29253  return __Pyx_PyObject_CallMethO(func, arg);
29254 #if CYTHON_FAST_PYCCALL
29255  } else if (__Pyx_PyFastCFunction_Check(func)) {
29256  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
29257 #endif
29258  }
29259  }
29260  return __Pyx__PyObject_CallOneArg(func, arg);
29261 }
29262 #else
29263 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29264  PyObject *result;
29265  PyObject *args = PyTuple_Pack(1, arg);
29266  if (unlikely(!args)) return NULL;
29267  result = __Pyx_PyObject_Call(func, args, NULL);
29268  Py_DECREF(args);
29269  return result;
29270 }
29271 #endif
29272 
29273 /* PyObjectCallNoArg */
29274 #if CYTHON_COMPILING_IN_CPYTHON
29275 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
29276 #if CYTHON_FAST_PYCALL
29277  if (PyFunction_Check(func)) {
29278  return __Pyx_PyFunction_FastCall(func, NULL, 0);
29279  }
29280 #endif
29281 #if defined(__Pyx_CyFunction_USED) && defined(NDEBUG)
29282  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
29283 #else
29284  if (likely(PyCFunction_Check(func)))
29285 #endif
29286  {
29287  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
29288  return __Pyx_PyObject_CallMethO(func, NULL);
29289  }
29290  }
29291  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
29292 }
29293 #endif
29294 
29295 /* GetItemInt */
29296 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29297  PyObject *r;
29298  if (!j) return NULL;
29299  r = PyObject_GetItem(o, j);
29300  Py_DECREF(j);
29301  return r;
29302 }
29303 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
29304  CYTHON_NCP_UNUSED int wraparound,
29305  CYTHON_NCP_UNUSED int boundscheck) {
29306 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29307  Py_ssize_t wrapped_i = i;
29308  if (wraparound & unlikely(i < 0)) {
29309  wrapped_i += PyList_GET_SIZE(o);
29310  }
29311  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
29312  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
29313  Py_INCREF(r);
29314  return r;
29315  }
29316  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29317 #else
29318  return PySequence_GetItem(o, i);
29319 #endif
29320 }
29321 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
29322  CYTHON_NCP_UNUSED int wraparound,
29323  CYTHON_NCP_UNUSED int boundscheck) {
29324 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29325  Py_ssize_t wrapped_i = i;
29326  if (wraparound & unlikely(i < 0)) {
29327  wrapped_i += PyTuple_GET_SIZE(o);
29328  }
29329  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29330  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29331  Py_INCREF(r);
29332  return r;
29333  }
29334  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29335 #else
29336  return PySequence_GetItem(o, i);
29337 #endif
29338 }
29339 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
29340  CYTHON_NCP_UNUSED int wraparound,
29341  CYTHON_NCP_UNUSED int boundscheck) {
29342 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29343  if (is_list || PyList_CheckExact(o)) {
29344  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29345  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29346  PyObject *r = PyList_GET_ITEM(o, n);
29347  Py_INCREF(r);
29348  return r;
29349  }
29350  }
29351  else if (PyTuple_CheckExact(o)) {
29352  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29353  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29354  PyObject *r = PyTuple_GET_ITEM(o, n);
29355  Py_INCREF(r);
29356  return r;
29357  }
29358  } else {
29359  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
29360  if (likely(m && m->sq_item)) {
29361  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
29362  Py_ssize_t l = m->sq_length(o);
29363  if (likely(l >= 0)) {
29364  i += l;
29365  } else {
29366  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29367  return NULL;
29368  PyErr_Clear();
29369  }
29370  }
29371  return m->sq_item(o, i);
29372  }
29373  }
29374 #else
29375  if (is_list || PySequence_Check(o)) {
29376  return PySequence_GetItem(o, i);
29377  }
29378 #endif
29379  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29380 }
29381 
29382 /* DictGetItem */
29383 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
29384 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
29385  PyObject *value;
29386  value = PyDict_GetItemWithError(d, key);
29387  if (unlikely(!value)) {
29388  if (!PyErr_Occurred()) {
29389  if (unlikely(PyTuple_Check(key))) {
29390  PyObject* args = PyTuple_Pack(1, key);
29391  if (likely(args)) {
29392  PyErr_SetObject(PyExc_KeyError, args);
29393  Py_DECREF(args);
29394  }
29395  } else {
29396  PyErr_SetObject(PyExc_KeyError, key);
29397  }
29398  }
29399  return NULL;
29400  }
29401  Py_INCREF(value);
29402  return value;
29403 }
29404 #endif
29405 
29406 /* MemviewSliceInit */
29407 static int
29408 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
29409  int ndim,
29410  __Pyx_memviewslice *memviewslice,
29411  int memview_is_new_reference)
29412 {
29413  __Pyx_RefNannyDeclarations
29414  int i, retval=-1;
29415  Py_buffer *buf = &memview->view;
29416  __Pyx_RefNannySetupContext("init_memviewslice", 0);
29417  if (unlikely(memviewslice->memview || memviewslice->data)) {
29418  PyErr_SetString(PyExc_ValueError,
29419  "memviewslice is already initialized!");
29420  goto fail;
29421  }
29422  if (buf->strides) {
29423  for (i = 0; i < ndim; i++) {
29424  memviewslice->strides[i] = buf->strides[i];
29425  }
29426  } else {
29427  Py_ssize_t stride = buf->itemsize;
29428  for (i = ndim - 1; i >= 0; i--) {
29429  memviewslice->strides[i] = stride;
29430  stride *= buf->shape[i];
29431  }
29432  }
29433  for (i = 0; i < ndim; i++) {
29434  memviewslice->shape[i] = buf->shape[i];
29435  if (buf->suboffsets) {
29436  memviewslice->suboffsets[i] = buf->suboffsets[i];
29437  } else {
29438  memviewslice->suboffsets[i] = -1;
29439  }
29440  }
29441  memviewslice->memview = memview;
29442  memviewslice->data = (char *)buf->buf;
29443  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
29444  Py_INCREF(memview);
29445  }
29446  retval = 0;
29447  goto no_fail;
29448 fail:
29449  memviewslice->memview = 0;
29450  memviewslice->data = 0;
29451  retval = -1;
29452 no_fail:
29453  __Pyx_RefNannyFinishContext();
29454  return retval;
29455 }
29456 #ifndef Py_NO_RETURN
29457 #define Py_NO_RETURN
29458 #endif
29459 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
29460  va_list vargs;
29461  char msg[200];
29462 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
29463  va_start(vargs, fmt);
29464 #else
29465  va_start(vargs);
29466 #endif
29467  vsnprintf(msg, 200, fmt, vargs);
29468  va_end(vargs);
29469  Py_FatalError(msg);
29470 }
29471 static CYTHON_INLINE int
29472 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29473  PyThread_type_lock lock)
29474 {
29475  int result;
29476  PyThread_acquire_lock(lock, 1);
29477  result = (*acquisition_count)++;
29478  PyThread_release_lock(lock);
29479  return result;
29480 }
29481 static CYTHON_INLINE int
29482 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29483  PyThread_type_lock lock)
29484 {
29485  int result;
29486  PyThread_acquire_lock(lock, 1);
29487  result = (*acquisition_count)--;
29488  PyThread_release_lock(lock);
29489  return result;
29490 }
29491 static CYTHON_INLINE void
29492 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
29493 {
29494  int first_time;
29495  struct __pyx_memoryview_obj *memview = memslice->memview;
29496  if (unlikely(!memview || (PyObject *) memview == Py_None))
29497  return;
29498  if (unlikely(__pyx_get_slice_count(memview) < 0))
29499  __pyx_fatalerror("Acquisition count is %d (line %d)",
29500  __pyx_get_slice_count(memview), lineno);
29501  first_time = __pyx_add_acquisition_count(memview) == 0;
29502  if (unlikely(first_time)) {
29503  if (have_gil) {
29504  Py_INCREF((PyObject *) memview);
29505  } else {
29506  PyGILState_STATE _gilstate = PyGILState_Ensure();
29507  Py_INCREF((PyObject *) memview);
29508  PyGILState_Release(_gilstate);
29509  }
29510  }
29511 }
29512 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
29513  int have_gil, int lineno) {
29514  int last_time;
29515  struct __pyx_memoryview_obj *memview = memslice->memview;
29516  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
29517  memslice->memview = NULL;
29518  return;
29519  }
29520  if (unlikely(__pyx_get_slice_count(memview) <= 0))
29521  __pyx_fatalerror("Acquisition count is %d (line %d)",
29522  __pyx_get_slice_count(memview), lineno);
29523  last_time = __pyx_sub_acquisition_count(memview) == 1;
29524  memslice->data = NULL;
29525  if (unlikely(last_time)) {
29526  if (have_gil) {
29527  Py_CLEAR(memslice->memview);
29528  } else {
29529  PyGILState_STATE _gilstate = PyGILState_Ensure();
29530  Py_CLEAR(memslice->memview);
29531  PyGILState_Release(_gilstate);
29532  }
29533  } else {
29534  memslice->memview = NULL;
29535  }
29536 }
29537 
29538 /* ArgTypeTest */
29539 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
29540 {
29541  if (unlikely(!type)) {
29542  PyErr_SetString(PyExc_SystemError, "Missing type object");
29543  return 0;
29544  }
29545  else if (exact) {
29546  #if PY_MAJOR_VERSION == 2
29547  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
29548  #endif
29549  }
29550  else {
29551  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
29552  }
29553  PyErr_Format(PyExc_TypeError,
29554  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
29555  name, type->tp_name, Py_TYPE(obj)->tp_name);
29556  return 0;
29557 }
29558 
29559 /* UnicodeEquals */
29560 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
29561 #if CYTHON_COMPILING_IN_PYPY
29562  return PyObject_RichCompareBool(s1, s2, equals);
29563 #else
29564 #if PY_MAJOR_VERSION < 3
29565  PyObject* owned_ref = NULL;
29566 #endif
29567  int s1_is_unicode, s2_is_unicode;
29568  if (s1 == s2) {
29569  goto return_eq;
29570  }
29571  s1_is_unicode = PyUnicode_CheckExact(s1);
29572  s2_is_unicode = PyUnicode_CheckExact(s2);
29573 #if PY_MAJOR_VERSION < 3
29574  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
29575  owned_ref = PyUnicode_FromObject(s2);
29576  if (unlikely(!owned_ref))
29577  return -1;
29578  s2 = owned_ref;
29579  s2_is_unicode = 1;
29580  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
29581  owned_ref = PyUnicode_FromObject(s1);
29582  if (unlikely(!owned_ref))
29583  return -1;
29584  s1 = owned_ref;
29585  s1_is_unicode = 1;
29586  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
29587  return __Pyx_PyBytes_Equals(s1, s2, equals);
29588  }
29589 #endif
29590  if (s1_is_unicode & s2_is_unicode) {
29591  Py_ssize_t length;
29592  int kind;
29593  void *data1, *data2;
29594  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
29595  return -1;
29596  length = __Pyx_PyUnicode_GET_LENGTH(s1);
29597  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
29598  goto return_ne;
29599  }
29600 #if CYTHON_USE_UNICODE_INTERNALS
29601  {
29602  Py_hash_t hash1, hash2;
29603  #if CYTHON_PEP393_ENABLED
29604  hash1 = ((PyASCIIObject*)s1)->hash;
29605  hash2 = ((PyASCIIObject*)s2)->hash;
29606  #else
29607  hash1 = ((PyUnicodeObject*)s1)->hash;
29608  hash2 = ((PyUnicodeObject*)s2)->hash;
29609  #endif
29610  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
29611  goto return_ne;
29612  }
29613  }
29614 #endif
29615  kind = __Pyx_PyUnicode_KIND(s1);
29616  if (kind != __Pyx_PyUnicode_KIND(s2)) {
29617  goto return_ne;
29618  }
29619  data1 = __Pyx_PyUnicode_DATA(s1);
29620  data2 = __Pyx_PyUnicode_DATA(s2);
29621  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
29622  goto return_ne;
29623  } else if (length == 1) {
29624  goto return_eq;
29625  } else {
29626  int result = memcmp(data1, data2, (size_t)(length * kind));
29627  #if PY_MAJOR_VERSION < 3
29628  Py_XDECREF(owned_ref);
29629  #endif
29630  return (equals == Py_EQ) ? (result == 0) : (result != 0);
29631  }
29632  } else if ((s1 == Py_None) & s2_is_unicode) {
29633  goto return_ne;
29634  } else if ((s2 == Py_None) & s1_is_unicode) {
29635  goto return_ne;
29636  } else {
29637  int result;
29638  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
29639  #if PY_MAJOR_VERSION < 3
29640  Py_XDECREF(owned_ref);
29641  #endif
29642  if (!py_result)
29643  return -1;
29644  result = __Pyx_PyObject_IsTrue(py_result);
29645  Py_DECREF(py_result);
29646  return result;
29647  }
29648 return_eq:
29649  #if PY_MAJOR_VERSION < 3
29650  Py_XDECREF(owned_ref);
29651  #endif
29652  return (equals == Py_EQ);
29653 return_ne:
29654  #if PY_MAJOR_VERSION < 3
29655  Py_XDECREF(owned_ref);
29656  #endif
29657  return (equals == Py_NE);
29658 #endif
29659 }
29660 
29661 /* WriteUnraisableException */
29662 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
29663  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
29664  int full_traceback, CYTHON_UNUSED int nogil) {
29665  PyObject *old_exc, *old_val, *old_tb;
29666  PyObject *ctx;
29667  __Pyx_PyThreadState_declare
29668 #ifdef WITH_THREAD
29669  PyGILState_STATE state;
29670  if (nogil)
29671  state = PyGILState_Ensure();
29672  else state = (PyGILState_STATE)0;
29673 #endif
29674  __Pyx_PyThreadState_assign
29675  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
29676  if (full_traceback) {
29677  Py_XINCREF(old_exc);
29678  Py_XINCREF(old_val);
29679  Py_XINCREF(old_tb);
29680  __Pyx_ErrRestore(old_exc, old_val, old_tb);
29681  PyErr_PrintEx(1);
29682  }
29683  #if PY_MAJOR_VERSION < 3
29684  ctx = PyString_FromString(name);
29685  #else
29686  ctx = PyUnicode_FromString(name);
29687  #endif
29688  __Pyx_ErrRestore(old_exc, old_val, old_tb);
29689  if (!ctx) {
29690  PyErr_WriteUnraisable(Py_None);
29691  } else {
29692  PyErr_WriteUnraisable(ctx);
29693  Py_DECREF(ctx);
29694  }
29695 #ifdef WITH_THREAD
29696  if (nogil)
29697  PyGILState_Release(state);
29698 #endif
29699 }
29700 
29701 /* GetAttr */
29702 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
29703 #if CYTHON_USE_TYPE_SLOTS
29704 #if PY_MAJOR_VERSION >= 3
29705  if (likely(PyUnicode_Check(n)))
29706 #else
29707  if (likely(PyString_Check(n)))
29708 #endif
29709  return __Pyx_PyObject_GetAttrStr(o, n);
29710 #endif
29711  return PyObject_GetAttr(o, n);
29712 }
29713 
29714 /* ObjectGetItem */
29715 #if CYTHON_USE_TYPE_SLOTS
29716 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
29717  PyObject *runerr = NULL;
29718  Py_ssize_t key_value;
29719  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
29720  if (unlikely(!(m && m->sq_item))) {
29721  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
29722  return NULL;
29723  }
29724  key_value = __Pyx_PyIndex_AsSsize_t(index);
29725  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
29726  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
29727  }
29728  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
29729  PyErr_Clear();
29730  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
29731  }
29732  return NULL;
29733 }
29734 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
29735  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
29736  if (likely(m && m->mp_subscript)) {
29737  return m->mp_subscript(obj, key);
29738  }
29739  return __Pyx_PyObject_GetIndex(obj, key);
29740 }
29741 #endif
29742 
29743 /* decode_c_string */
29744 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
29745  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
29746  const char* encoding, const char* errors,
29747  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
29748  Py_ssize_t length;
29749  if (unlikely((start < 0) | (stop < 0))) {
29750  size_t slen = strlen(cstring);
29751  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
29752  PyErr_SetString(PyExc_OverflowError,
29753  "c-string too long to convert to Python");
29754  return NULL;
29755  }
29756  length = (Py_ssize_t) slen;
29757  if (start < 0) {
29758  start += length;
29759  if (start < 0)
29760  start = 0;
29761  }
29762  if (stop < 0)
29763  stop += length;
29764  }
29765  if (unlikely(stop <= start))
29766  return __Pyx_NewRef(__pyx_empty_unicode);
29767  length = stop - start;
29768  cstring += start;
29769  if (decode_func) {
29770  return decode_func(cstring, length, errors);
29771  } else {
29772  return PyUnicode_Decode(cstring, length, encoding, errors);
29773  }
29774 }
29775 
29776 /* PyErrExceptionMatches */
29777 #if CYTHON_FAST_THREAD_STATE
29778 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29779  Py_ssize_t i, n;
29780  n = PyTuple_GET_SIZE(tuple);
29781 #if PY_MAJOR_VERSION >= 3
29782  for (i=0; i<n; i++) {
29783  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
29784  }
29785 #endif
29786  for (i=0; i<n; i++) {
29787  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
29788  }
29789  return 0;
29790 }
29791 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
29792  PyObject *exc_type = tstate->curexc_type;
29793  if (exc_type == err) return 1;
29794  if (unlikely(!exc_type)) return 0;
29795  if (unlikely(PyTuple_Check(err)))
29796  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
29797  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
29798 }
29799 #endif
29800 
29801 /* GetAttr3 */
29802 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
29803  __Pyx_PyThreadState_declare
29804  __Pyx_PyThreadState_assign
29805  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
29806  return NULL;
29807  __Pyx_PyErr_Clear();
29808  Py_INCREF(d);
29809  return d;
29810 }
29811 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
29812  PyObject *r = __Pyx_GetAttr(o, n);
29813  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
29814 }
29815 
29816 /* RaiseTooManyValuesToUnpack */
29817 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
29818  PyErr_Format(PyExc_ValueError,
29819  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
29820 }
29821 
29822 /* RaiseNeedMoreValuesToUnpack */
29823 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
29824  PyErr_Format(PyExc_ValueError,
29825  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
29826  index, (index == 1) ? "" : "s");
29827 }
29828 
29829 /* RaiseNoneIterError */
29830 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
29831  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
29832 }
29833 
29834 /* ExtTypeTest */
29835 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
29836  if (unlikely(!type)) {
29837  PyErr_SetString(PyExc_SystemError, "Missing type object");
29838  return 0;
29839  }
29840  if (likely(__Pyx_TypeCheck(obj, type)))
29841  return 1;
29842  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
29843  Py_TYPE(obj)->tp_name, type->tp_name);
29844  return 0;
29845 }
29846 
29847 /* GetTopmostException */
29848 #if CYTHON_USE_EXC_INFO_STACK
29849 static _PyErr_StackItem *
29850 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
29851 {
29852  _PyErr_StackItem *exc_info = tstate->exc_info;
29853  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
29854  exc_info->previous_item != NULL)
29855  {
29856  exc_info = exc_info->previous_item;
29857  }
29858  return exc_info;
29859 }
29860 #endif
29861 
29862 /* SaveResetException */
29863 #if CYTHON_FAST_THREAD_STATE
29864 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29865  #if CYTHON_USE_EXC_INFO_STACK
29866  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
29867  *type = exc_info->exc_type;
29868  *value = exc_info->exc_value;
29869  *tb = exc_info->exc_traceback;
29870  #else
29871  *type = tstate->exc_type;
29872  *value = tstate->exc_value;
29873  *tb = tstate->exc_traceback;
29874  #endif
29875  Py_XINCREF(*type);
29876  Py_XINCREF(*value);
29877  Py_XINCREF(*tb);
29878 }
29879 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29880  PyObject *tmp_type, *tmp_value, *tmp_tb;
29881  #if CYTHON_USE_EXC_INFO_STACK
29882  _PyErr_StackItem *exc_info = tstate->exc_info;
29883  tmp_type = exc_info->exc_type;
29884  tmp_value = exc_info->exc_value;
29885  tmp_tb = exc_info->exc_traceback;
29886  exc_info->exc_type = type;
29887  exc_info->exc_value = value;
29888  exc_info->exc_traceback = tb;
29889  #else
29890  tmp_type = tstate->exc_type;
29891  tmp_value = tstate->exc_value;
29892  tmp_tb = tstate->exc_traceback;
29893  tstate->exc_type = type;
29894  tstate->exc_value = value;
29895  tstate->exc_traceback = tb;
29896  #endif
29897  Py_XDECREF(tmp_type);
29898  Py_XDECREF(tmp_value);
29899  Py_XDECREF(tmp_tb);
29900 }
29901 #endif
29902 
29903 /* GetException */
29904 #if CYTHON_FAST_THREAD_STATE
29905 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
29906 #else
29907 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
29908 #endif
29909 {
29910  PyObject *local_type, *local_value, *local_tb;
29911 #if CYTHON_FAST_THREAD_STATE
29912  PyObject *tmp_type, *tmp_value, *tmp_tb;
29913  local_type = tstate->curexc_type;
29914  local_value = tstate->curexc_value;
29915  local_tb = tstate->curexc_traceback;
29916  tstate->curexc_type = 0;
29917  tstate->curexc_value = 0;
29918  tstate->curexc_traceback = 0;
29919 #else
29920  PyErr_Fetch(&local_type, &local_value, &local_tb);
29921 #endif
29922  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
29923 #if CYTHON_FAST_THREAD_STATE
29924  if (unlikely(tstate->curexc_type))
29925 #else
29926  if (unlikely(PyErr_Occurred()))
29927 #endif
29928  goto bad;
29929  #if PY_MAJOR_VERSION >= 3
29930  if (local_tb) {
29931  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
29932  goto bad;
29933  }
29934  #endif
29935  Py_XINCREF(local_tb);
29936  Py_XINCREF(local_type);
29937  Py_XINCREF(local_value);
29938  *type = local_type;
29939  *value = local_value;
29940  *tb = local_tb;
29941 #if CYTHON_FAST_THREAD_STATE
29942  #if CYTHON_USE_EXC_INFO_STACK
29943  {
29944  _PyErr_StackItem *exc_info = tstate->exc_info;
29945  tmp_type = exc_info->exc_type;
29946  tmp_value = exc_info->exc_value;
29947  tmp_tb = exc_info->exc_traceback;
29948  exc_info->exc_type = local_type;
29949  exc_info->exc_value = local_value;
29950  exc_info->exc_traceback = local_tb;
29951  }
29952  #else
29953  tmp_type = tstate->exc_type;
29954  tmp_value = tstate->exc_value;
29955  tmp_tb = tstate->exc_traceback;
29956  tstate->exc_type = local_type;
29957  tstate->exc_value = local_value;
29958  tstate->exc_traceback = local_tb;
29959  #endif
29960  Py_XDECREF(tmp_type);
29961  Py_XDECREF(tmp_value);
29962  Py_XDECREF(tmp_tb);
29963 #else
29964  PyErr_SetExcInfo(local_type, local_value, local_tb);
29965 #endif
29966  return 0;
29967 bad:
29968  *type = 0;
29969  *value = 0;
29970  *tb = 0;
29971  Py_XDECREF(local_type);
29972  Py_XDECREF(local_value);
29973  Py_XDECREF(local_tb);
29974  return -1;
29975 }
29976 
29977 /* SwapException */
29978 #if CYTHON_FAST_THREAD_STATE
29979 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29980  PyObject *tmp_type, *tmp_value, *tmp_tb;
29981  #if CYTHON_USE_EXC_INFO_STACK
29982  _PyErr_StackItem *exc_info = tstate->exc_info;
29983  tmp_type = exc_info->exc_type;
29984  tmp_value = exc_info->exc_value;
29985  tmp_tb = exc_info->exc_traceback;
29986  exc_info->exc_type = *type;
29987  exc_info->exc_value = *value;
29988  exc_info->exc_traceback = *tb;
29989  #else
29990  tmp_type = tstate->exc_type;
29991  tmp_value = tstate->exc_value;
29992  tmp_tb = tstate->exc_traceback;
29993  tstate->exc_type = *type;
29994  tstate->exc_value = *value;
29995  tstate->exc_traceback = *tb;
29996  #endif
29997  *type = tmp_type;
29998  *value = tmp_value;
29999  *tb = tmp_tb;
30000 }
30001 #else
30002 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
30003  PyObject *tmp_type, *tmp_value, *tmp_tb;
30004  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
30005  PyErr_SetExcInfo(*type, *value, *tb);
30006  *type = tmp_type;
30007  *value = tmp_value;
30008  *tb = tmp_tb;
30009 }
30010 #endif
30011 
30012 /* Import */
30013 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
30014  PyObject *empty_list = 0;
30015  PyObject *module = 0;
30016  PyObject *global_dict = 0;
30017  PyObject *empty_dict = 0;
30018  PyObject *list;
30019  #if PY_MAJOR_VERSION < 3
30020  PyObject *py_import;
30021  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
30022  if (!py_import)
30023  goto bad;
30024  #endif
30025  if (from_list)
30026  list = from_list;
30027  else {
30028  empty_list = PyList_New(0);
30029  if (!empty_list)
30030  goto bad;
30031  list = empty_list;
30032  }
30033  global_dict = PyModule_GetDict(__pyx_m);
30034  if (!global_dict)
30035  goto bad;
30036  empty_dict = PyDict_New();
30037  if (!empty_dict)
30038  goto bad;
30039  {
30040  #if PY_MAJOR_VERSION >= 3
30041  if (level == -1) {
30042  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
30043  module = PyImport_ImportModuleLevelObject(
30044  name, global_dict, empty_dict, list, 1);
30045  if (!module) {
30046  if (!PyErr_ExceptionMatches(PyExc_ImportError))
30047  goto bad;
30048  PyErr_Clear();
30049  }
30050  }
30051  level = 0;
30052  }
30053  #endif
30054  if (!module) {
30055  #if PY_MAJOR_VERSION < 3
30056  PyObject *py_level = PyInt_FromLong(level);
30057  if (!py_level)
30058  goto bad;
30059  module = PyObject_CallFunctionObjArgs(py_import,
30060  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
30061  Py_DECREF(py_level);
30062  #else
30063  module = PyImport_ImportModuleLevelObject(
30064  name, global_dict, empty_dict, list, level);
30065  #endif
30066  }
30067  }
30068 bad:
30069  #if PY_MAJOR_VERSION < 3
30070  Py_XDECREF(py_import);
30071  #endif
30072  Py_XDECREF(empty_list);
30073  Py_XDECREF(empty_dict);
30074  return module;
30075 }
30076 
30077 /* FastTypeChecks */
30078 #if CYTHON_COMPILING_IN_CPYTHON
30079 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30080  while (a) {
30081  a = a->tp_base;
30082  if (a == b)
30083  return 1;
30084  }
30085  return b == &PyBaseObject_Type;
30086 }
30087 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30088  PyObject *mro;
30089  if (a == b) return 1;
30090  mro = a->tp_mro;
30091  if (likely(mro)) {
30092  Py_ssize_t i, n;
30093  n = PyTuple_GET_SIZE(mro);
30094  for (i = 0; i < n; i++) {
30095  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30096  return 1;
30097  }
30098  return 0;
30099  }
30100  return __Pyx_InBases(a, b);
30101 }
30102 #if PY_MAJOR_VERSION == 2
30103 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
30104  PyObject *exception, *value, *tb;
30105  int res;
30106  __Pyx_PyThreadState_declare
30107  __Pyx_PyThreadState_assign
30108  __Pyx_ErrFetch(&exception, &value, &tb);
30109  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
30110  if (unlikely(res == -1)) {
30111  PyErr_WriteUnraisable(err);
30112  res = 0;
30113  }
30114  if (!res) {
30115  res = PyObject_IsSubclass(err, exc_type2);
30116  if (unlikely(res == -1)) {
30117  PyErr_WriteUnraisable(err);
30118  res = 0;
30119  }
30120  }
30121  __Pyx_ErrRestore(exception, value, tb);
30122  return res;
30123 }
30124 #else
30125 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
30126  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
30127  if (!res) {
30128  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
30129  }
30130  return res;
30131 }
30132 #endif
30133 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30134  Py_ssize_t i, n;
30135  assert(PyExceptionClass_Check(exc_type));
30136  n = PyTuple_GET_SIZE(tuple);
30137 #if PY_MAJOR_VERSION >= 3
30138  for (i=0; i<n; i++) {
30139  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30140  }
30141 #endif
30142  for (i=0; i<n; i++) {
30143  PyObject *t = PyTuple_GET_ITEM(tuple, i);
30144  #if PY_MAJOR_VERSION < 3
30145  if (likely(exc_type == t)) return 1;
30146  #endif
30147  if (likely(PyExceptionClass_Check(t))) {
30148  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
30149  } else {
30150  }
30151  }
30152  return 0;
30153 }
30154 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
30155  if (likely(err == exc_type)) return 1;
30156  if (likely(PyExceptionClass_Check(err))) {
30157  if (likely(PyExceptionClass_Check(exc_type))) {
30158  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
30159  } else if (likely(PyTuple_Check(exc_type))) {
30160  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
30161  } else {
30162  }
30163  }
30164  return PyErr_GivenExceptionMatches(err, exc_type);
30165 }
30166 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
30167  assert(PyExceptionClass_Check(exc_type1));
30168  assert(PyExceptionClass_Check(exc_type2));
30169  if (likely(err == exc_type1 || err == exc_type2)) return 1;
30170  if (likely(PyExceptionClass_Check(err))) {
30171  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
30172  }
30173  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
30174 }
30175 #endif
30176 
30177 /* PyIntBinop */
30178 #if !CYTHON_COMPILING_IN_PYPY
30179 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
30180  (void)inplace;
30181  (void)zerodivision_check;
30182  #if PY_MAJOR_VERSION < 3
30183  if (likely(PyInt_CheckExact(op1))) {
30184  const long b = intval;
30185  long x;
30186  long a = PyInt_AS_LONG(op1);
30187  x = (long)((unsigned long)a + b);
30188  if (likely((x^a) >= 0 || (x^b) >= 0))
30189  return PyInt_FromLong(x);
30190  return PyLong_Type.tp_as_number->nb_add(op1, op2);
30191  }
30192  #endif
30193  #if CYTHON_USE_PYLONG_INTERNALS
30194  if (likely(PyLong_CheckExact(op1))) {
30195  const long b = intval;
30196  long a, x;
30197 #ifdef HAVE_LONG_LONG
30198  const PY_LONG_LONG llb = intval;
30199  PY_LONG_LONG lla, llx;
30200 #endif
30201  const digit* digits = ((PyLongObject*)op1)->ob_digit;
30202  const Py_ssize_t size = Py_SIZE(op1);
30203  if (likely(__Pyx_sst_abs(size) <= 1)) {
30204  a = likely(size) ? digits[0] : 0;
30205  if (size == -1) a = -a;
30206  } else {
30207  switch (size) {
30208  case -2:
30209  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30210  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30211  break;
30212 #ifdef HAVE_LONG_LONG
30213  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30214  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30215  goto long_long;
30216 #endif
30217  }
30218  CYTHON_FALLTHROUGH;
30219  case 2:
30220  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30221  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30222  break;
30223 #ifdef HAVE_LONG_LONG
30224  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30225  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30226  goto long_long;
30227 #endif
30228  }
30229  CYTHON_FALLTHROUGH;
30230  case -3:
30231  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30232  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30233  break;
30234 #ifdef HAVE_LONG_LONG
30235  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30236  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30237  goto long_long;
30238 #endif
30239  }
30240  CYTHON_FALLTHROUGH;
30241  case 3:
30242  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30243  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30244  break;
30245 #ifdef HAVE_LONG_LONG
30246  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30247  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30248  goto long_long;
30249 #endif
30250  }
30251  CYTHON_FALLTHROUGH;
30252  case -4:
30253  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30254  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30255  break;
30256 #ifdef HAVE_LONG_LONG
30257  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30258  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30259  goto long_long;
30260 #endif
30261  }
30262  CYTHON_FALLTHROUGH;
30263  case 4:
30264  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30265  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30266  break;
30267 #ifdef HAVE_LONG_LONG
30268  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30269  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30270  goto long_long;
30271 #endif
30272  }
30273  CYTHON_FALLTHROUGH;
30274  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
30275  }
30276  }
30277  x = a + b;
30278  return PyLong_FromLong(x);
30279 #ifdef HAVE_LONG_LONG
30280  long_long:
30281  llx = lla + llb;
30282  return PyLong_FromLongLong(llx);
30283 #endif
30284 
30285 
30286  }
30287  #endif
30288  if (PyFloat_CheckExact(op1)) {
30289  const long b = intval;
30290  double a = PyFloat_AS_DOUBLE(op1);
30291  double result;
30292  PyFPE_START_PROTECT("add", return NULL)
30293  result = ((double)a) + (double)b;
30294  PyFPE_END_PROTECT(result)
30295  return PyFloat_FromDouble(result);
30296  }
30297  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
30298 }
30299 #endif
30300 
30301 /* None */
30302 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
30303  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
30304 }
30305 
30306 /* ImportFrom */
30307 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
30308  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
30309  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30310  PyErr_Format(PyExc_ImportError,
30311  #if PY_MAJOR_VERSION < 3
30312  "cannot import name %.230s", PyString_AS_STRING(name));
30313  #else
30314  "cannot import name %S", name);
30315  #endif
30316  }
30317  return value;
30318 }
30319 
30320 /* HasAttr */
30321 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
30322  PyObject *r;
30323  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
30324  PyErr_SetString(PyExc_TypeError,
30325  "hasattr(): attribute name must be string");
30326  return -1;
30327  }
30328  r = __Pyx_GetAttr(o, n);
30329  if (unlikely(!r)) {
30330  PyErr_Clear();
30331  return 0;
30332  } else {
30333  Py_DECREF(r);
30334  return 1;
30335  }
30336 }
30337 
30338 /* CallNextTpDealloc */
30339 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
30340  PyTypeObject* type = Py_TYPE(obj);
30341  while (type && type->tp_dealloc != current_tp_dealloc)
30342  type = type->tp_base;
30343  while (type && type->tp_dealloc == current_tp_dealloc)
30344  type = type->tp_base;
30345  if (type)
30346  type->tp_dealloc(obj);
30347 }
30348 
30349 /* CallNextTpTraverse */
30350 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
30351  PyTypeObject* type = Py_TYPE(obj);
30352  while (type && type->tp_traverse != current_tp_traverse)
30353  type = type->tp_base;
30354  while (type && type->tp_traverse == current_tp_traverse)
30355  type = type->tp_base;
30356  if (type && type->tp_traverse)
30357  return type->tp_traverse(obj, v, a);
30358  return 0;
30359 }
30360 
30361 /* CallNextTpClear */
30362 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
30363  PyTypeObject* type = Py_TYPE(obj);
30364  while (type && type->tp_clear != current_tp_clear)
30365  type = type->tp_base;
30366  while (type && type->tp_clear == current_tp_clear)
30367  type = type->tp_base;
30368  if (type && type->tp_clear)
30369  type->tp_clear(obj);
30370 }
30371 
30372 /* PyObject_GenericGetAttrNoDict */
30373 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30374 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
30375  PyErr_Format(PyExc_AttributeError,
30376 #if PY_MAJOR_VERSION >= 3
30377  "'%.50s' object has no attribute '%U'",
30378  tp->tp_name, attr_name);
30379 #else
30380  "'%.50s' object has no attribute '%.400s'",
30381  tp->tp_name, PyString_AS_STRING(attr_name));
30382 #endif
30383  return NULL;
30384 }
30385 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
30386  PyObject *descr;
30387  PyTypeObject *tp = Py_TYPE(obj);
30388  if (unlikely(!PyString_Check(attr_name))) {
30389  return PyObject_GenericGetAttr(obj, attr_name);
30390  }
30391  assert(!tp->tp_dictoffset);
30392  descr = _PyType_Lookup(tp, attr_name);
30393  if (unlikely(!descr)) {
30394  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
30395  }
30396  Py_INCREF(descr);
30397  #if PY_MAJOR_VERSION < 3
30398  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
30399  #endif
30400  {
30401  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
30402  if (unlikely(f)) {
30403  PyObject *res = f(descr, obj, (PyObject *)tp);
30404  Py_DECREF(descr);
30405  return res;
30406  }
30407  }
30408  return descr;
30409 }
30410 #endif
30411 
30412 /* PyObject_GenericGetAttr */
30413 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30414 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
30415  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
30416  return PyObject_GenericGetAttr(obj, attr_name);
30417  }
30418  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
30419 }
30420 #endif
30421 
30422 /* TypeImport */
30423 #ifndef __PYX_HAVE_RT_ImportType_0_29_36
30424 #define __PYX_HAVE_RT_ImportType_0_29_36
30425 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name,
30426  size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size)
30427 {
30428  PyObject *result = 0;
30429  char warning[200];
30430  Py_ssize_t basicsize;
30431  Py_ssize_t itemsize;
30432 #ifdef Py_LIMITED_API
30433  PyObject *py_basicsize;
30434  PyObject *py_itemsize;
30435 #endif
30436  result = PyObject_GetAttrString(module, class_name);
30437  if (!result)
30438  goto bad;
30439  if (!PyType_Check(result)) {
30440  PyErr_Format(PyExc_TypeError,
30441  "%.200s.%.200s is not a type object",
30442  module_name, class_name);
30443  goto bad;
30444  }
30445 #ifndef Py_LIMITED_API
30446  basicsize = ((PyTypeObject *)result)->tp_basicsize;
30447  itemsize = ((PyTypeObject *)result)->tp_itemsize;
30448 #else
30449  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
30450  if (!py_basicsize)
30451  goto bad;
30452  basicsize = PyLong_AsSsize_t(py_basicsize);
30453  Py_DECREF(py_basicsize);
30454  py_basicsize = 0;
30455  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
30456  goto bad;
30457  py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
30458  if (!py_itemsize)
30459  goto bad;
30460  itemsize = PyLong_AsSsize_t(py_itemsize);
30461  Py_DECREF(py_itemsize);
30462  py_itemsize = 0;
30463  if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
30464  goto bad;
30465 #endif
30466  if (itemsize) {
30467  if (size % alignment) {
30468  alignment = size % alignment;
30469  }
30470  if (itemsize < (Py_ssize_t)alignment)
30471  itemsize = (Py_ssize_t)alignment;
30472  }
30473  if ((size_t)(basicsize + itemsize) < size) {
30474  PyErr_Format(PyExc_ValueError,
30475  "%.200s.%.200s size changed, may indicate binary incompatibility. "
30476  "Expected %zd from C header, got %zd from PyObject",
30477  module_name, class_name, size, basicsize);
30478  goto bad;
30479  }
30480  if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) {
30481  PyErr_Format(PyExc_ValueError,
30482  "%.200s.%.200s size changed, may indicate binary incompatibility. "
30483  "Expected %zd from C header, got %zd from PyObject",
30484  module_name, class_name, size, basicsize);
30485  goto bad;
30486  }
30487  else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) {
30488  PyOS_snprintf(warning, sizeof(warning),
30489  "%s.%s size changed, may indicate binary incompatibility. "
30490  "Expected %zd from C header, got %zd from PyObject",
30491  module_name, class_name, size, basicsize);
30492  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
30493  }
30494  return (PyTypeObject *)result;
30495 bad:
30496  Py_XDECREF(result);
30497  return NULL;
30498 }
30499 #endif
30500 
30501 /* GetVTable */
30502 static void* __Pyx_GetVtable(PyObject *dict) {
30503  void* ptr;
30504  PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
30505  if (!ob)
30506  goto bad;
30507 #if PY_VERSION_HEX >= 0x02070000
30508  ptr = PyCapsule_GetPointer(ob, 0);
30509 #else
30510  ptr = PyCObject_AsVoidPtr(ob);
30511 #endif
30512  if (!ptr && !PyErr_Occurred())
30513  PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
30514  Py_DECREF(ob);
30515  return ptr;
30516 bad:
30517  Py_XDECREF(ob);
30518  return NULL;
30519 }
30520 
30521 /* SetVTable */
30522 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
30523 #if PY_VERSION_HEX >= 0x02070000
30524  PyObject *ob = PyCapsule_New(vtable, 0, 0);
30525 #else
30526  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
30527 #endif
30528  if (!ob)
30529  goto bad;
30530  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
30531  goto bad;
30532  Py_DECREF(ob);
30533  return 0;
30534 bad:
30535  Py_XDECREF(ob);
30536  return -1;
30537 }
30538 
30539 /* PyObjectGetAttrStrNoError */
30540 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
30541  __Pyx_PyThreadState_declare
30542  __Pyx_PyThreadState_assign
30543  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30544  __Pyx_PyErr_Clear();
30545 }
30546 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
30547  PyObject *result;
30548 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
30549  PyTypeObject* tp = Py_TYPE(obj);
30550  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
30551  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
30552  }
30553 #endif
30554  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
30555  if (unlikely(!result)) {
30556  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
30557  }
30558  return result;
30559 }
30560 
30561 /* SetupReduce */
30562 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
30563  int ret;
30564  PyObject *name_attr;
30565  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
30566  if (likely(name_attr)) {
30567  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
30568  } else {
30569  ret = -1;
30570  }
30571  if (unlikely(ret < 0)) {
30572  PyErr_Clear();
30573  ret = 0;
30574  }
30575  Py_XDECREF(name_attr);
30576  return ret;
30577 }
30578 static int __Pyx_setup_reduce(PyObject* type_obj) {
30579  int ret = 0;
30580  PyObject *object_reduce = NULL;
30581  PyObject *object_getstate = NULL;
30582  PyObject *object_reduce_ex = NULL;
30583  PyObject *reduce = NULL;
30584  PyObject *reduce_ex = NULL;
30585  PyObject *reduce_cython = NULL;
30586  PyObject *setstate = NULL;
30587  PyObject *setstate_cython = NULL;
30588  PyObject *getstate = NULL;
30589 #if CYTHON_USE_PYTYPE_LOOKUP
30590  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
30591 #else
30592  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
30593  if (!getstate && PyErr_Occurred()) {
30594  goto __PYX_BAD;
30595  }
30596 #endif
30597  if (getstate) {
30598 #if CYTHON_USE_PYTYPE_LOOKUP
30599  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
30600 #else
30601  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
30602  if (!object_getstate && PyErr_Occurred()) {
30603  goto __PYX_BAD;
30604  }
30605 #endif
30606  if (object_getstate != getstate) {
30607  goto __PYX_GOOD;
30608  }
30609  }
30610 #if CYTHON_USE_PYTYPE_LOOKUP
30611  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
30612 #else
30613  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
30614 #endif
30615  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
30616  if (reduce_ex == object_reduce_ex) {
30617 #if CYTHON_USE_PYTYPE_LOOKUP
30618  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
30619 #else
30620  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
30621 #endif
30622  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
30623  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
30624  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
30625  if (likely(reduce_cython)) {
30626  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
30627  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
30628  } else if (reduce == object_reduce || PyErr_Occurred()) {
30629  goto __PYX_BAD;
30630  }
30631  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
30632  if (!setstate) PyErr_Clear();
30633  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
30634  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
30635  if (likely(setstate_cython)) {
30636  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
30637  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
30638  } else if (!setstate || PyErr_Occurred()) {
30639  goto __PYX_BAD;
30640  }
30641  }
30642  PyType_Modified((PyTypeObject*)type_obj);
30643  }
30644  }
30645  goto __PYX_GOOD;
30646 __PYX_BAD:
30647  if (!PyErr_Occurred())
30648  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
30649  ret = -1;
30650 __PYX_GOOD:
30651 #if !CYTHON_USE_PYTYPE_LOOKUP
30652  Py_XDECREF(object_reduce);
30653  Py_XDECREF(object_reduce_ex);
30654  Py_XDECREF(object_getstate);
30655  Py_XDECREF(getstate);
30656 #endif
30657  Py_XDECREF(reduce);
30658  Py_XDECREF(reduce_ex);
30659  Py_XDECREF(reduce_cython);
30660  Py_XDECREF(setstate);
30661  Py_XDECREF(setstate_cython);
30662  return ret;
30663 }
30664 
30665 /* FetchCommonType */
30666 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
30667  PyObject* fake_module;
30668  PyTypeObject* cached_type = NULL;
30669  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
30670  if (!fake_module) return NULL;
30671  Py_INCREF(fake_module);
30672  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
30673  if (cached_type) {
30674  if (!PyType_Check((PyObject*)cached_type)) {
30675  PyErr_Format(PyExc_TypeError,
30676  "Shared Cython type %.200s is not a type object",
30677  type->tp_name);
30678  goto bad;
30679  }
30680  if (cached_type->tp_basicsize != type->tp_basicsize) {
30681  PyErr_Format(PyExc_TypeError,
30682  "Shared Cython type %.200s has the wrong size, try recompiling",
30683  type->tp_name);
30684  goto bad;
30685  }
30686  } else {
30687  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
30688  PyErr_Clear();
30689  if (PyType_Ready(type) < 0) goto bad;
30690  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
30691  goto bad;
30692  Py_INCREF(type);
30693  cached_type = type;
30694  }
30695 done:
30696  Py_DECREF(fake_module);
30697  return cached_type;
30698 bad:
30699  Py_XDECREF(cached_type);
30700  cached_type = NULL;
30701  goto done;
30702 }
30703 
30704 /* CythonFunctionShared */
30705 #include <structmember.h>
30706 static PyObject *
30707 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
30708 {
30709  if (unlikely(op->func_doc == NULL)) {
30710  if (op->func.m_ml->ml_doc) {
30711 #if PY_MAJOR_VERSION >= 3
30712  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
30713 #else
30714  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
30715 #endif
30716  if (unlikely(op->func_doc == NULL))
30717  return NULL;
30718  } else {
30719  Py_INCREF(Py_None);
30720  return Py_None;
30721  }
30722  }
30723  Py_INCREF(op->func_doc);
30724  return op->func_doc;
30725 }
30726 static int
30727 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
30728 {
30729  PyObject *tmp = op->func_doc;
30730  if (value == NULL) {
30731  value = Py_None;
30732  }
30733  Py_INCREF(value);
30734  op->func_doc = value;
30735  Py_XDECREF(tmp);
30736  return 0;
30737 }
30738 static PyObject *
30739 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30740 {
30741  if (unlikely(op->func_name == NULL)) {
30742 #if PY_MAJOR_VERSION >= 3
30743  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
30744 #else
30745  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
30746 #endif
30747  if (unlikely(op->func_name == NULL))
30748  return NULL;
30749  }
30750  Py_INCREF(op->func_name);
30751  return op->func_name;
30752 }
30753 static int
30754 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
30755 {
30756  PyObject *tmp;
30757 #if PY_MAJOR_VERSION >= 3
30758  if (unlikely(value == NULL || !PyUnicode_Check(value)))
30759 #else
30760  if (unlikely(value == NULL || !PyString_Check(value)))
30761 #endif
30762  {
30763  PyErr_SetString(PyExc_TypeError,
30764  "__name__ must be set to a string object");
30765  return -1;
30766  }
30767  tmp = op->func_name;
30768  Py_INCREF(value);
30769  op->func_name = value;
30770  Py_XDECREF(tmp);
30771  return 0;
30772 }
30773 static PyObject *
30774 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30775 {
30776  Py_INCREF(op->func_qualname);
30777  return op->func_qualname;
30778 }
30779 static int
30780 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
30781 {
30782  PyObject *tmp;
30783 #if PY_MAJOR_VERSION >= 3
30784  if (unlikely(value == NULL || !PyUnicode_Check(value)))
30785 #else
30786  if (unlikely(value == NULL || !PyString_Check(value)))
30787 #endif
30788  {
30789  PyErr_SetString(PyExc_TypeError,
30790  "__qualname__ must be set to a string object");
30791  return -1;
30792  }
30793  tmp = op->func_qualname;
30794  Py_INCREF(value);
30795  op->func_qualname = value;
30796  Py_XDECREF(tmp);
30797  return 0;
30798 }
30799 static PyObject *
30800 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
30801 {
30802  PyObject *self;
30803  self = m->func_closure;
30804  if (self == NULL)
30805  self = Py_None;
30806  Py_INCREF(self);
30807  return self;
30808 }
30809 static PyObject *
30810 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30811 {
30812  if (unlikely(op->func_dict == NULL)) {
30813  op->func_dict = PyDict_New();
30814  if (unlikely(op->func_dict == NULL))
30815  return NULL;
30816  }
30817  Py_INCREF(op->func_dict);
30818  return op->func_dict;
30819 }
30820 static int
30821 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
30822 {
30823  PyObject *tmp;
30824  if (unlikely(value == NULL)) {
30825  PyErr_SetString(PyExc_TypeError,
30826  "function's dictionary may not be deleted");
30827  return -1;
30828  }
30829  if (unlikely(!PyDict_Check(value))) {
30830  PyErr_SetString(PyExc_TypeError,
30831  "setting function's dictionary to a non-dict");
30832  return -1;
30833  }
30834  tmp = op->func_dict;
30835  Py_INCREF(value);
30836  op->func_dict = value;
30837  Py_XDECREF(tmp);
30838  return 0;
30839 }
30840 static PyObject *
30841 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30842 {
30843  Py_INCREF(op->func_globals);
30844  return op->func_globals;
30845 }
30846 static PyObject *
30847 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30848 {
30849  Py_INCREF(Py_None);
30850  return Py_None;
30851 }
30852 static PyObject *
30853 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30854 {
30855  PyObject* result = (op->func_code) ? op->func_code : Py_None;
30856  Py_INCREF(result);
30857  return result;
30858 }
30859 static int
30860 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
30861  int result = 0;
30862  PyObject *res = op->defaults_getter((PyObject *) op);
30863  if (unlikely(!res))
30864  return -1;
30865  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30866  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
30867  Py_INCREF(op->defaults_tuple);
30868  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
30869  Py_INCREF(op->defaults_kwdict);
30870  #else
30871  op->defaults_tuple = PySequence_ITEM(res, 0);
30872  if (unlikely(!op->defaults_tuple)) result = -1;
30873  else {
30874  op->defaults_kwdict = PySequence_ITEM(res, 1);
30875  if (unlikely(!op->defaults_kwdict)) result = -1;
30876  }
30877  #endif
30878  Py_DECREF(res);
30879  return result;
30880 }
30881 static int
30882 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
30883  PyObject* tmp;
30884  if (!value) {
30885  value = Py_None;
30886  } else if (value != Py_None && !PyTuple_Check(value)) {
30887  PyErr_SetString(PyExc_TypeError,
30888  "__defaults__ must be set to a tuple object");
30889  return -1;
30890  }
30891  Py_INCREF(value);
30892  tmp = op->defaults_tuple;
30893  op->defaults_tuple = value;
30894  Py_XDECREF(tmp);
30895  return 0;
30896 }
30897 static PyObject *
30898 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
30899  PyObject* result = op->defaults_tuple;
30900  if (unlikely(!result)) {
30901  if (op->defaults_getter) {
30902  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
30903  result = op->defaults_tuple;
30904  } else {
30905  result = Py_None;
30906  }
30907  }
30908  Py_INCREF(result);
30909  return result;
30910 }
30911 static int
30912 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
30913  PyObject* tmp;
30914  if (!value) {
30915  value = Py_None;
30916  } else if (value != Py_None && !PyDict_Check(value)) {
30917  PyErr_SetString(PyExc_TypeError,
30918  "__kwdefaults__ must be set to a dict object");
30919  return -1;
30920  }
30921  Py_INCREF(value);
30922  tmp = op->defaults_kwdict;
30923  op->defaults_kwdict = value;
30924  Py_XDECREF(tmp);
30925  return 0;
30926 }
30927 static PyObject *
30928 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
30929  PyObject* result = op->defaults_kwdict;
30930  if (unlikely(!result)) {
30931  if (op->defaults_getter) {
30932  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
30933  result = op->defaults_kwdict;
30934  } else {
30935  result = Py_None;
30936  }
30937  }
30938  Py_INCREF(result);
30939  return result;
30940 }
30941 static int
30942 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
30943  PyObject* tmp;
30944  if (!value || value == Py_None) {
30945  value = NULL;
30946  } else if (!PyDict_Check(value)) {
30947  PyErr_SetString(PyExc_TypeError,
30948  "__annotations__ must be set to a dict object");
30949  return -1;
30950  }
30951  Py_XINCREF(value);
30952  tmp = op->func_annotations;
30953  op->func_annotations = value;
30954  Py_XDECREF(tmp);
30955  return 0;
30956 }
30957 static PyObject *
30958 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
30959  PyObject* result = op->func_annotations;
30960  if (unlikely(!result)) {
30961  result = PyDict_New();
30962  if (unlikely(!result)) return NULL;
30963  op->func_annotations = result;
30964  }
30965  Py_INCREF(result);
30966  return result;
30967 }
30968 static PyGetSetDef __pyx_CyFunction_getsets[] = {
30969  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30970  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30971  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30972  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30973  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
30974  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
30975  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
30976  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
30977  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30978  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30979  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30980  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30981  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
30982  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
30983  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
30984  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
30985  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
30986  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
30987  {0, 0, 0, 0, 0}
30988 };
30989 static PyMemberDef __pyx_CyFunction_members[] = {
30990  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
30991  {0, 0, 0, 0, 0}
30992 };
30993 static PyObject *
30994 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
30995 {
30996 #if PY_MAJOR_VERSION >= 3
30997  Py_INCREF(m->func_qualname);
30998  return m->func_qualname;
30999 #else
31000  return PyString_FromString(m->func.m_ml->ml_name);
31001 #endif
31002 }
31003 static PyMethodDef __pyx_CyFunction_methods[] = {
31004  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
31005  {0, 0, 0, 0}
31006 };
31007 #if PY_VERSION_HEX < 0x030500A0
31008 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
31009 #else
31010 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
31011 #endif
31012 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
31013  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31014  if (unlikely(op == NULL))
31015  return NULL;
31016  op->flags = flags;
31017  __Pyx_CyFunction_weakreflist(op) = NULL;
31018  op->func.m_ml = ml;
31019  op->func.m_self = (PyObject *) op;
31020  Py_XINCREF(closure);
31021  op->func_closure = closure;
31022  Py_XINCREF(module);
31023  op->func.m_module = module;
31024  op->func_dict = NULL;
31025  op->func_name = NULL;
31026  Py_INCREF(qualname);
31027  op->func_qualname = qualname;
31028  op->func_doc = NULL;
31029  op->func_classobj = NULL;
31030  op->func_globals = globals;
31031  Py_INCREF(op->func_globals);
31032  Py_XINCREF(code);
31033  op->func_code = code;
31034  op->defaults_pyobjects = 0;
31035  op->defaults_size = 0;
31036  op->defaults = NULL;
31037  op->defaults_tuple = NULL;
31038  op->defaults_kwdict = NULL;
31039  op->defaults_getter = NULL;
31040  op->func_annotations = NULL;
31041  return (PyObject *) op;
31042 }
31043 static int
31044 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
31045 {
31046  Py_CLEAR(m->func_closure);
31047  Py_CLEAR(m->func.m_module);
31048  Py_CLEAR(m->func_dict);
31049  Py_CLEAR(m->func_name);
31050  Py_CLEAR(m->func_qualname);
31051  Py_CLEAR(m->func_doc);
31052  Py_CLEAR(m->func_globals);
31053  Py_CLEAR(m->func_code);
31054  Py_CLEAR(m->func_classobj);
31055  Py_CLEAR(m->defaults_tuple);
31056  Py_CLEAR(m->defaults_kwdict);
31057  Py_CLEAR(m->func_annotations);
31058  if (m->defaults) {
31059  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
31060  int i;
31061  for (i = 0; i < m->defaults_pyobjects; i++)
31062  Py_XDECREF(pydefaults[i]);
31063  PyObject_Free(m->defaults);
31064  m->defaults = NULL;
31065  }
31066  return 0;
31067 }
31068 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
31069 {
31070  if (__Pyx_CyFunction_weakreflist(m) != NULL)
31071  PyObject_ClearWeakRefs((PyObject *) m);
31072  __Pyx_CyFunction_clear(m);
31073  PyObject_GC_Del(m);
31074 }
31075 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
31076 {
31077  PyObject_GC_UnTrack(m);
31078  __Pyx__CyFunction_dealloc(m);
31079 }
31080 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
31081 {
31082  Py_VISIT(m->func_closure);
31083  Py_VISIT(m->func.m_module);
31084  Py_VISIT(m->func_dict);
31085  Py_VISIT(m->func_name);
31086  Py_VISIT(m->func_qualname);
31087  Py_VISIT(m->func_doc);
31088  Py_VISIT(m->func_globals);
31089  Py_VISIT(m->func_code);
31090  Py_VISIT(m->func_classobj);
31091  Py_VISIT(m->defaults_tuple);
31092  Py_VISIT(m->defaults_kwdict);
31093  if (m->defaults) {
31094  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
31095  int i;
31096  for (i = 0; i < m->defaults_pyobjects; i++)
31097  Py_VISIT(pydefaults[i]);
31098  }
31099  return 0;
31100 }
31101 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
31102 {
31103 #if PY_MAJOR_VERSION < 3
31104  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31105  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
31106  Py_INCREF(func);
31107  return func;
31108  }
31109  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
31110  if (type == NULL)
31111  type = (PyObject *)(Py_TYPE(obj));
31112  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
31113  }
31114  if (obj == Py_None)
31115  obj = NULL;
31116 #endif
31117  return __Pyx_PyMethod_New(func, obj, type);
31118 }
31119 static PyObject*
31120 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
31121 {
31122 #if PY_MAJOR_VERSION >= 3
31123  return PyUnicode_FromFormat("<cyfunction %U at %p>",
31124  op->func_qualname, (void *)op);
31125 #else
31126  return PyString_FromFormat("<cyfunction %s at %p>",
31127  PyString_AsString(op->func_qualname), (void *)op);
31128 #endif
31129 }
31130 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
31131  PyCFunctionObject* f = (PyCFunctionObject*)func;
31132  PyCFunction meth = f->m_ml->ml_meth;
31133  Py_ssize_t size;
31134  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
31135  case METH_VARARGS:
31136  if (likely(kw == NULL || PyDict_Size(kw) == 0))
31137  return (*meth)(self, arg);
31138  break;
31139  case METH_VARARGS | METH_KEYWORDS:
31140  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
31141  case METH_NOARGS:
31142  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31143  size = PyTuple_GET_SIZE(arg);
31144  if (likely(size == 0))
31145  return (*meth)(self, NULL);
31146  PyErr_Format(PyExc_TypeError,
31147  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
31148  f->m_ml->ml_name, size);
31149  return NULL;
31150  }
31151  break;
31152  case METH_O:
31153  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
31154  size = PyTuple_GET_SIZE(arg);
31155  if (likely(size == 1)) {
31156  PyObject *result, *arg0;
31157  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31158  arg0 = PyTuple_GET_ITEM(arg, 0);
31159  #else
31160  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
31161  #endif
31162  result = (*meth)(self, arg0);
31163  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
31164  Py_DECREF(arg0);
31165  #endif
31166  return result;
31167  }
31168  PyErr_Format(PyExc_TypeError,
31169  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
31170  f->m_ml->ml_name, size);
31171  return NULL;
31172  }
31173  break;
31174  default:
31175  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
31176  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
31177  "longer supported!");
31178  return NULL;
31179  }
31180  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
31181  f->m_ml->ml_name);
31182  return NULL;
31183 }
31184 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
31185  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
31186 }
31187 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
31188  PyObject *result;
31189  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
31190  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
31191  Py_ssize_t argc;
31192  PyObject *new_args;
31193  PyObject *self;
31194  argc = PyTuple_GET_SIZE(args);
31195  new_args = PyTuple_GetSlice(args, 1, argc);
31196  if (unlikely(!new_args))
31197  return NULL;
31198  self = PyTuple_GetItem(args, 0);
31199  if (unlikely(!self)) {
31200  Py_DECREF(new_args);
31201 #if PY_MAJOR_VERSION > 2
31202  PyErr_Format(PyExc_TypeError,
31203  "unbound method %.200S() needs an argument",
31204  cyfunc->func_qualname);
31205 #else
31206  PyErr_SetString(PyExc_TypeError,
31207  "unbound method needs an argument");
31208 #endif
31209  return NULL;
31210  }
31211  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
31212  Py_DECREF(new_args);
31213  } else {
31214  result = __Pyx_CyFunction_Call(func, args, kw);
31215  }
31216  return result;
31217 }
31218 static PyTypeObject __pyx_CyFunctionType_type = {
31219  PyVarObject_HEAD_INIT(0, 0)
31220  "cython_function_or_method",
31221  sizeof(__pyx_CyFunctionObject),
31222  0,
31223  (destructor) __Pyx_CyFunction_dealloc,
31224  0,
31225  0,
31226  0,
31227 #if PY_MAJOR_VERSION < 3
31228  0,
31229 #else
31230  0,
31231 #endif
31232  (reprfunc) __Pyx_CyFunction_repr,
31233  0,
31234  0,
31235  0,
31236  0,
31237  __Pyx_CyFunction_CallAsMethod,
31238  0,
31239  0,
31240  0,
31241  0,
31242  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
31243  0,
31244  (traverseproc) __Pyx_CyFunction_traverse,
31245  (inquiry) __Pyx_CyFunction_clear,
31246  0,
31247 #if PY_VERSION_HEX < 0x030500A0
31248  offsetof(__pyx_CyFunctionObject, func_weakreflist),
31249 #else
31250  offsetof(PyCFunctionObject, m_weakreflist),
31251 #endif
31252  0,
31253  0,
31254  __pyx_CyFunction_methods,
31255  __pyx_CyFunction_members,
31256  __pyx_CyFunction_getsets,
31257  0,
31258  0,
31259  __Pyx_CyFunction_descr_get,
31260  0,
31261  offsetof(__pyx_CyFunctionObject, func_dict),
31262  0,
31263  0,
31264  0,
31265  0,
31266  0,
31267  0,
31268  0,
31269  0,
31270  0,
31271  0,
31272  0,
31273  0,
31274 #if PY_VERSION_HEX >= 0x030400a1
31275  0,
31276 #endif
31277 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
31278  0,
31279 #endif
31280 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31281  0,
31282 #endif
31283 #if PY_VERSION_HEX >= 0x030C0000
31284  0,
31285 #endif
31286 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
31287  0,
31288 #endif
31289 };
31290 static int __pyx_CyFunction_init(void) {
31291  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
31292  if (unlikely(__pyx_CyFunctionType == NULL)) {
31293  return -1;
31294  }
31295  return 0;
31296 }
31297 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
31298  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31299  m->defaults = PyObject_Malloc(size);
31300  if (unlikely(!m->defaults))
31301  return PyErr_NoMemory();
31302  memset(m->defaults, 0, size);
31303  m->defaults_pyobjects = pyobjects;
31304  m->defaults_size = size;
31305  return m->defaults;
31306 }
31307 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
31308  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31309  m->defaults_tuple = tuple;
31310  Py_INCREF(tuple);
31311 }
31312 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
31313  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31314  m->defaults_kwdict = dict;
31315  Py_INCREF(dict);
31316 }
31317 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
31318  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31319  m->func_annotations = dict;
31320  Py_INCREF(dict);
31321 }
31322 
31323 /* CythonFunction */
31324 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
31325  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31326  PyObject *op = __Pyx_CyFunction_Init(
31327  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
31328  ml, flags, qualname, closure, module, globals, code
31329  );
31330  if (likely(op)) {
31331  PyObject_GC_Track(op);
31332  }
31333  return op;
31334 }
31335 
31336 /* CLineInTraceback */
31337 #ifndef CYTHON_CLINE_IN_TRACEBACK
31338 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
31339  PyObject *use_cline;
31340  PyObject *ptype, *pvalue, *ptraceback;
31341 #if CYTHON_COMPILING_IN_CPYTHON
31342  PyObject **cython_runtime_dict;
31343 #endif
31344  if (unlikely(!__pyx_cython_runtime)) {
31345  return c_line;
31346  }
31347  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31348 #if CYTHON_COMPILING_IN_CPYTHON
31349  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
31350  if (likely(cython_runtime_dict)) {
31351  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
31352  use_cline, *cython_runtime_dict,
31353  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
31354  } else
31355 #endif
31356  {
31357  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
31358  if (use_cline_obj) {
31359  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
31360  Py_DECREF(use_cline_obj);
31361  } else {
31362  PyErr_Clear();
31363  use_cline = NULL;
31364  }
31365  }
31366  if (!use_cline) {
31367  c_line = 0;
31368  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
31369  }
31370  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
31371  c_line = 0;
31372  }
31373  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31374  return c_line;
31375 }
31376 #endif
31377 
31378 /* CodeObjectCache */
31379 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
31380  int start = 0, mid = 0, end = count - 1;
31381  if (end >= 0 && code_line > entries[end].code_line) {
31382  return count;
31383  }
31384  while (start < end) {
31385  mid = start + (end - start) / 2;
31386  if (code_line < entries[mid].code_line) {
31387  end = mid;
31388  } else if (code_line > entries[mid].code_line) {
31389  start = mid + 1;
31390  } else {
31391  return mid;
31392  }
31393  }
31394  if (code_line <= entries[mid].code_line) {
31395  return mid;
31396  } else {
31397  return mid + 1;
31398  }
31399 }
31400 static PyCodeObject *__pyx_find_code_object(int code_line) {
31401  PyCodeObject* code_object;
31402  int pos;
31403  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
31404  return NULL;
31405  }
31406  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
31407  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
31408  return NULL;
31409  }
31410  code_object = __pyx_code_cache.entries[pos].code_object;
31411  Py_INCREF(code_object);
31412  return code_object;
31413 }
31414 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
31415  int pos, i;
31416  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
31417  if (unlikely(!code_line)) {
31418  return;
31419  }
31420  if (unlikely(!entries)) {
31421  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
31422  if (likely(entries)) {
31423  __pyx_code_cache.entries = entries;
31424  __pyx_code_cache.max_count = 64;
31425  __pyx_code_cache.count = 1;
31426  entries[0].code_line = code_line;
31427  entries[0].code_object = code_object;
31428  Py_INCREF(code_object);
31429  }
31430  return;
31431  }
31432  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
31433  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
31434  PyCodeObject* tmp = entries[pos].code_object;
31435  entries[pos].code_object = code_object;
31436  Py_DECREF(tmp);
31437  return;
31438  }
31439  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
31440  int new_max = __pyx_code_cache.max_count + 64;
31441  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
31442  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
31443  if (unlikely(!entries)) {
31444  return;
31445  }
31446  __pyx_code_cache.entries = entries;
31447  __pyx_code_cache.max_count = new_max;
31448  }
31449  for (i=__pyx_code_cache.count; i>pos; i--) {
31450  entries[i] = entries[i-1];
31451  }
31452  entries[pos].code_line = code_line;
31453  entries[pos].code_object = code_object;
31454  __pyx_code_cache.count++;
31455  Py_INCREF(code_object);
31456 }
31457 
31458 /* AddTraceback */
31459 #include "compile.h"
31460 #include "frameobject.h"
31461 #include "traceback.h"
31462 #if PY_VERSION_HEX >= 0x030b00a6
31463  #ifndef Py_BUILD_CORE
31464  #define Py_BUILD_CORE 1
31465  #endif
31466  #include "internal/pycore_frame.h"
31467 #endif
31468 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
31469  const char *funcname, int c_line,
31470  int py_line, const char *filename) {
31471  PyCodeObject *py_code = NULL;
31472  PyObject *py_funcname = NULL;
31473  #if PY_MAJOR_VERSION < 3
31474  PyObject *py_srcfile = NULL;
31475  py_srcfile = PyString_FromString(filename);
31476  if (!py_srcfile) goto bad;
31477  #endif
31478  if (c_line) {
31479  #if PY_MAJOR_VERSION < 3
31480  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31481  if (!py_funcname) goto bad;
31482  #else
31483  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31484  if (!py_funcname) goto bad;
31485  funcname = PyUnicode_AsUTF8(py_funcname);
31486  if (!funcname) goto bad;
31487  #endif
31488  }
31489  else {
31490  #if PY_MAJOR_VERSION < 3
31491  py_funcname = PyString_FromString(funcname);
31492  if (!py_funcname) goto bad;
31493  #endif
31494  }
31495  #if PY_MAJOR_VERSION < 3
31496  py_code = __Pyx_PyCode_New(
31497  0,
31498  0,
31499  0,
31500  0,
31501  0,
31502  __pyx_empty_bytes, /*PyObject *code,*/
31503  __pyx_empty_tuple, /*PyObject *consts,*/
31504  __pyx_empty_tuple, /*PyObject *names,*/
31505  __pyx_empty_tuple, /*PyObject *varnames,*/
31506  __pyx_empty_tuple, /*PyObject *freevars,*/
31507  __pyx_empty_tuple, /*PyObject *cellvars,*/
31508  py_srcfile, /*PyObject *filename,*/
31509  py_funcname, /*PyObject *name,*/
31510  py_line,
31511  __pyx_empty_bytes /*PyObject *lnotab*/
31512  );
31513  Py_DECREF(py_srcfile);
31514  #else
31515  py_code = PyCode_NewEmpty(filename, funcname, py_line);
31516  #endif
31517  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
31518  return py_code;
31519 bad:
31520  Py_XDECREF(py_funcname);
31521  #if PY_MAJOR_VERSION < 3
31522  Py_XDECREF(py_srcfile);
31523  #endif
31524  return NULL;
31525 }
31526 static void __Pyx_AddTraceback(const char *funcname, int c_line,
31527  int py_line, const char *filename) {
31528  PyCodeObject *py_code = 0;
31529  PyFrameObject *py_frame = 0;
31530  PyThreadState *tstate = __Pyx_PyThreadState_Current;
31531  PyObject *ptype, *pvalue, *ptraceback;
31532  if (c_line) {
31533  c_line = __Pyx_CLineForTraceback(tstate, c_line);
31534  }
31535  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
31536  if (!py_code) {
31537  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31538  py_code = __Pyx_CreateCodeObjectForTraceback(
31539  funcname, c_line, py_line, filename);
31540  if (!py_code) {
31541  /* If the code object creation fails, then we should clear the
31542  fetched exception references and propagate the new exception */
31543  Py_XDECREF(ptype);
31544  Py_XDECREF(pvalue);
31545  Py_XDECREF(ptraceback);
31546  goto bad;
31547  }
31548  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31549  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
31550  }
31551  py_frame = PyFrame_New(
31552  tstate, /*PyThreadState *tstate,*/
31553  py_code, /*PyCodeObject *code,*/
31554  __pyx_d, /*PyObject *globals,*/
31555  0 /*PyObject *locals*/
31556  );
31557  if (!py_frame) goto bad;
31558  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
31559  PyTraceBack_Here(py_frame);
31560 bad:
31561  Py_XDECREF(py_code);
31562  Py_XDECREF(py_frame);
31563 }
31564 
31565 #if PY_MAJOR_VERSION < 3
31566 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
31567  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
31568  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
31569  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
31570  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
31571  return -1;
31572 }
31573 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
31574  PyObject *obj = view->obj;
31575  if (!obj) return;
31576  if (PyObject_CheckBuffer(obj)) {
31577  PyBuffer_Release(view);
31578  return;
31579  }
31580  if ((0)) {}
31581  view->obj = NULL;
31582  Py_DECREF(obj);
31583 }
31584 #endif
31585 
31586 
31587 /* MemviewSliceIsContig */
31588 static int
31589 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
31590 {
31591  int i, index, step, start;
31592  Py_ssize_t itemsize = mvs.memview->view.itemsize;
31593  if (order == 'F') {
31594  step = 1;
31595  start = 0;
31596  } else {
31597  step = -1;
31598  start = ndim - 1;
31599  }
31600  for (i = 0; i < ndim; i++) {
31601  index = start + step * i;
31602  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
31603  return 0;
31604  itemsize *= mvs.shape[index];
31605  }
31606  return 1;
31607 }
31608 
31609 /* OverlappingSlices */
31610 static void
31611 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
31612  void **out_start, void **out_end,
31613  int ndim, size_t itemsize)
31614 {
31615  char *start, *end;
31616  int i;
31617  start = end = slice->data;
31618  for (i = 0; i < ndim; i++) {
31619  Py_ssize_t stride = slice->strides[i];
31620  Py_ssize_t extent = slice->shape[i];
31621  if (extent == 0) {
31622  *out_start = *out_end = start;
31623  return;
31624  } else {
31625  if (stride > 0)
31626  end += stride * (extent - 1);
31627  else
31628  start += stride * (extent - 1);
31629  }
31630  }
31631  *out_start = start;
31632  *out_end = end + itemsize;
31633 }
31634 static int
31635 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
31636  __Pyx_memviewslice *slice2,
31637  int ndim, size_t itemsize)
31638 {
31639  void *start1, *end1, *start2, *end2;
31640  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
31641  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
31642  return (start1 < end2) && (start2 < end1);
31643 }
31644 
31645 /* Capsule */
31646 static CYTHON_INLINE PyObject *
31647 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
31648 {
31649  PyObject *cobj;
31650 #if PY_VERSION_HEX >= 0x02070000
31651  cobj = PyCapsule_New(p, sig, NULL);
31652 #else
31653  cobj = PyCObject_FromVoidPtr(p, NULL);
31654 #endif
31655  return cobj;
31656 }
31657 
31658 /* CIntFromPyVerify */
31659 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
31660  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
31661 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
31662  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
31663 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
31664  {\
31665  func_type value = func_value;\
31666  if (sizeof(target_type) < sizeof(func_type)) {\
31667  if (unlikely(value != (func_type) (target_type) value)) {\
31668  func_type zero = 0;\
31669  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
31670  return (target_type) -1;\
31671  if (is_unsigned && unlikely(value < zero))\
31672  goto raise_neg_overflow;\
31673  else\
31674  goto raise_overflow;\
31675  }\
31676  }\
31677  return (target_type) value;\
31678  }
31679 
31680 /* IsLittleEndian */
31681 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
31682 {
31683  union {
31684  uint32_t u32;
31685  uint8_t u8[4];
31686  } S;
31687  S.u32 = 0x01020304;
31688  return S.u8[0] == 4;
31689 }
31690 
31691 /* BufferFormatCheck */
31692 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
31693  __Pyx_BufFmt_StackElem* stack,
31694  __Pyx_TypeInfo* type) {
31695  stack[0].field = &ctx->root;
31696  stack[0].parent_offset = 0;
31697  ctx->root.type = type;
31698  ctx->root.name = "buffer dtype";
31699  ctx->root.offset = 0;
31700  ctx->head = stack;
31701  ctx->head->field = &ctx->root;
31702  ctx->fmt_offset = 0;
31703  ctx->head->parent_offset = 0;
31704  ctx->new_packmode = '@';
31705  ctx->enc_packmode = '@';
31706  ctx->new_count = 1;
31707  ctx->enc_count = 0;
31708  ctx->enc_type = 0;
31709  ctx->is_complex = 0;
31710  ctx->is_valid_array = 0;
31711  ctx->struct_alignment = 0;
31712  while (type->typegroup == 'S') {
31713  ++ctx->head;
31714  ctx->head->field = type->fields;
31715  ctx->head->parent_offset = 0;
31716  type = type->fields->type;
31717  }
31718 }
31719 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
31720  int count;
31721  const char* t = *ts;
31722  if (*t < '0' || *t > '9') {
31723  return -1;
31724  } else {
31725  count = *t++ - '0';
31726  while (*t >= '0' && *t <= '9') {
31727  count *= 10;
31728  count += *t++ - '0';
31729  }
31730  }
31731  *ts = t;
31732  return count;
31733 }
31734 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
31735  int number = __Pyx_BufFmt_ParseNumber(ts);
31736  if (number == -1)
31737  PyErr_Format(PyExc_ValueError,\
31738  "Does not understand character buffer dtype format string ('%c')", **ts);
31739  return number;
31740 }
31741 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
31742  PyErr_Format(PyExc_ValueError,
31743  "Unexpected format string character: '%c'", ch);
31744 }
31745 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
31746  switch (ch) {
31747  case '?': return "'bool'";
31748  case 'c': return "'char'";
31749  case 'b': return "'signed char'";
31750  case 'B': return "'unsigned char'";
31751  case 'h': return "'short'";
31752  case 'H': return "'unsigned short'";
31753  case 'i': return "'int'";
31754  case 'I': return "'unsigned int'";
31755  case 'l': return "'long'";
31756  case 'L': return "'unsigned long'";
31757  case 'q': return "'long long'";
31758  case 'Q': return "'unsigned long long'";
31759  case 'f': return (is_complex ? "'complex float'" : "'float'");
31760  case 'd': return (is_complex ? "'complex double'" : "'double'");
31761  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
31762  case 'T': return "a struct";
31763  case 'O': return "Python object";
31764  case 'P': return "a pointer";
31765  case 's': case 'p': return "a string";
31766  case 0: return "end";
31767  default: return "unparseable format string";
31768  }
31769 }
31770 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
31771  switch (ch) {
31772  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31773  case 'h': case 'H': return 2;
31774  case 'i': case 'I': case 'l': case 'L': return 4;
31775  case 'q': case 'Q': return 8;
31776  case 'f': return (is_complex ? 8 : 4);
31777  case 'd': return (is_complex ? 16 : 8);
31778  case 'g': {
31779  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
31780  return 0;
31781  }
31782  case 'O': case 'P': return sizeof(void*);
31783  default:
31784  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31785  return 0;
31786  }
31787 }
31788 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
31789  switch (ch) {
31790  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31791  case 'h': case 'H': return sizeof(short);
31792  case 'i': case 'I': return sizeof(int);
31793  case 'l': case 'L': return sizeof(long);
31794  #ifdef HAVE_LONG_LONG
31795  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
31796  #endif
31797  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
31798  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
31799  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
31800  case 'O': case 'P': return sizeof(void*);
31801  default: {
31802  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31803  return 0;
31804  }
31805  }
31806 }
31807 typedef struct { char c; short x; } __Pyx_st_short;
31808 typedef struct { char c; int x; } __Pyx_st_int;
31809 typedef struct { char c; long x; } __Pyx_st_long;
31810 typedef struct { char c; float x; } __Pyx_st_float;
31811 typedef struct { char c; double x; } __Pyx_st_double;
31812 typedef struct { char c; long double x; } __Pyx_st_longdouble;
31813 typedef struct { char c; void *x; } __Pyx_st_void_p;
31814 #ifdef HAVE_LONG_LONG
31815 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
31816 #endif
31817 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
31818  switch (ch) {
31819  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31820  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
31821  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
31822  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
31823 #ifdef HAVE_LONG_LONG
31824  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
31825 #endif
31826  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
31827  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
31828  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
31829  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
31830  default:
31831  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31832  return 0;
31833  }
31834 }
31835 /* These are for computing the padding at the end of the struct to align
31836  on the first member of the struct. This will probably the same as above,
31837  but we don't have any guarantees.
31838  */
31839 typedef struct { short x; char c; } __Pyx_pad_short;
31840 typedef struct { int x; char c; } __Pyx_pad_int;
31841 typedef struct { long x; char c; } __Pyx_pad_long;
31842 typedef struct { float x; char c; } __Pyx_pad_float;
31843 typedef struct { double x; char c; } __Pyx_pad_double;
31844 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
31845 typedef struct { void *x; char c; } __Pyx_pad_void_p;
31846 #ifdef HAVE_LONG_LONG
31847 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
31848 #endif
31849 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
31850  switch (ch) {
31851  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31852  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
31853  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
31854  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
31855 #ifdef HAVE_LONG_LONG
31856  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
31857 #endif
31858  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
31859  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
31860  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
31861  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
31862  default:
31863  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31864  return 0;
31865  }
31866 }
31867 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
31868  switch (ch) {
31869  case 'c':
31870  return 'H';
31871  case 'b': case 'h': case 'i':
31872  case 'l': case 'q': case 's': case 'p':
31873  return 'I';
31874  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
31875  return 'U';
31876  case 'f': case 'd': case 'g':
31877  return (is_complex ? 'C' : 'R');
31878  case 'O':
31879  return 'O';
31880  case 'P':
31881  return 'P';
31882  default: {
31883  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31884  return 0;
31885  }
31886  }
31887 }
31888 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
31889  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
31890  const char* expected;
31891  const char* quote;
31892  if (ctx->head == NULL) {
31893  expected = "end";
31894  quote = "";
31895  } else {
31896  expected = ctx->head->field->type->name;
31897  quote = "'";
31898  }
31899  PyErr_Format(PyExc_ValueError,
31900  "Buffer dtype mismatch, expected %s%s%s but got %s",
31901  quote, expected, quote,
31902  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
31903  } else {
31904  __Pyx_StructField* field = ctx->head->field;
31905  __Pyx_StructField* parent = (ctx->head - 1)->field;
31906  PyErr_Format(PyExc_ValueError,
31907  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
31908  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
31909  parent->type->name, field->name);
31910  }
31911 }
31912 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
31913  char group;
31914  size_t size, offset, arraysize = 1;
31915  if (ctx->enc_type == 0) return 0;
31916  if (ctx->head->field->type->arraysize[0]) {
31917  int i, ndim = 0;
31918  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
31919  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
31920  ndim = 1;
31921  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
31922  PyErr_Format(PyExc_ValueError,
31923  "Expected a dimension of size %zu, got %zu",
31924  ctx->head->field->type->arraysize[0], ctx->enc_count);
31925  return -1;
31926  }
31927  }
31928  if (!ctx->is_valid_array) {
31929  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
31930  ctx->head->field->type->ndim, ndim);
31931  return -1;
31932  }
31933  for (i = 0; i < ctx->head->field->type->ndim; i++) {
31934  arraysize *= ctx->head->field->type->arraysize[i];
31935  }
31936  ctx->is_valid_array = 0;
31937  ctx->enc_count = 1;
31938  }
31939  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
31940  do {
31941  __Pyx_StructField* field = ctx->head->field;
31942  __Pyx_TypeInfo* type = field->type;
31943  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
31944  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
31945  } else {
31946  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
31947  }
31948  if (ctx->enc_packmode == '@') {
31949  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
31950  size_t align_mod_offset;
31951  if (align_at == 0) return -1;
31952  align_mod_offset = ctx->fmt_offset % align_at;
31953  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
31954  if (ctx->struct_alignment == 0)
31955  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
31956  ctx->is_complex);
31957  }
31958  if (type->size != size || type->typegroup != group) {
31959  if (type->typegroup == 'C' && type->fields != NULL) {
31960  size_t parent_offset = ctx->head->parent_offset + field->offset;
31961  ++ctx->head;
31962  ctx->head->field = type->fields;
31963  ctx->head->parent_offset = parent_offset;
31964  continue;
31965  }
31966  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
31967  } else {
31968  __Pyx_BufFmt_RaiseExpected(ctx);
31969  return -1;
31970  }
31971  }
31972  offset = ctx->head->parent_offset + field->offset;
31973  if (ctx->fmt_offset != offset) {
31974  PyErr_Format(PyExc_ValueError,
31975  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
31976  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
31977  return -1;
31978  }
31979  ctx->fmt_offset += size;
31980  if (arraysize)
31981  ctx->fmt_offset += (arraysize - 1) * size;
31982  --ctx->enc_count;
31983  while (1) {
31984  if (field == &ctx->root) {
31985  ctx->head = NULL;
31986  if (ctx->enc_count != 0) {
31987  __Pyx_BufFmt_RaiseExpected(ctx);
31988  return -1;
31989  }
31990  break;
31991  }
31992  ctx->head->field = ++field;
31993  if (field->type == NULL) {
31994  --ctx->head;
31995  field = ctx->head->field;
31996  continue;
31997  } else if (field->type->typegroup == 'S') {
31998  size_t parent_offset = ctx->head->parent_offset + field->offset;
31999  if (field->type->fields->type == NULL) continue;
32000  field = field->type->fields;
32001  ++ctx->head;
32002  ctx->head->field = field;
32003  ctx->head->parent_offset = parent_offset;
32004  break;
32005  } else {
32006  break;
32007  }
32008  }
32009  } while (ctx->enc_count);
32010  ctx->enc_type = 0;
32011  ctx->is_complex = 0;
32012  return 0;
32013 }
32014 static PyObject *
32015 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
32016 {
32017  const char *ts = *tsp;
32018  int i = 0, number, ndim;
32019  ++ts;
32020  if (ctx->new_count != 1) {
32021  PyErr_SetString(PyExc_ValueError,
32022  "Cannot handle repeated arrays in format string");
32023  return NULL;
32024  }
32025  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
32026  ndim = ctx->head->field->type->ndim;
32027  while (*ts && *ts != ')') {
32028  switch (*ts) {
32029  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
32030  default: break;
32031  }
32032  number = __Pyx_BufFmt_ExpectNumber(&ts);
32033  if (number == -1) return NULL;
32034  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
32035  return PyErr_Format(PyExc_ValueError,
32036  "Expected a dimension of size %zu, got %d",
32037  ctx->head->field->type->arraysize[i], number);
32038  if (*ts != ',' && *ts != ')')
32039  return PyErr_Format(PyExc_ValueError,
32040  "Expected a comma in format string, got '%c'", *ts);
32041  if (*ts == ',') ts++;
32042  i++;
32043  }
32044  if (i != ndim)
32045  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
32046  ctx->head->field->type->ndim, i);
32047  if (!*ts) {
32048  PyErr_SetString(PyExc_ValueError,
32049  "Unexpected end of format string, expected ')'");
32050  return NULL;
32051  }
32052  ctx->is_valid_array = 1;
32053  ctx->new_count = 1;
32054  *tsp = ++ts;
32055  return Py_None;
32056 }
32057 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
32058  int got_Z = 0;
32059  while (1) {
32060  switch(*ts) {
32061  case 0:
32062  if (ctx->enc_type != 0 && ctx->head == NULL) {
32063  __Pyx_BufFmt_RaiseExpected(ctx);
32064  return NULL;
32065  }
32066  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
32067  if (ctx->head != NULL) {
32068  __Pyx_BufFmt_RaiseExpected(ctx);
32069  return NULL;
32070  }
32071  return ts;
32072  case ' ':
32073  case '\r':
32074  case '\n':
32075  ++ts;
32076  break;
32077  case '<':
32078  if (!__Pyx_Is_Little_Endian()) {
32079  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
32080  return NULL;
32081  }
32082  ctx->new_packmode = '=';
32083  ++ts;
32084  break;
32085  case '>':
32086  case '!':
32087  if (__Pyx_Is_Little_Endian()) {
32088  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
32089  return NULL;
32090  }
32091  ctx->new_packmode = '=';
32092  ++ts;
32093  break;
32094  case '=':
32095  case '@':
32096  case '^':
32097  ctx->new_packmode = *ts++;
32098  break;
32099  case 'T':
32100  {
32101  const char* ts_after_sub;
32102  size_t i, struct_count = ctx->new_count;
32103  size_t struct_alignment = ctx->struct_alignment;
32104  ctx->new_count = 1;
32105  ++ts;
32106  if (*ts != '{') {
32107  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
32108  return NULL;
32109  }
32110  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
32111  ctx->enc_type = 0;
32112  ctx->enc_count = 0;
32113  ctx->struct_alignment = 0;
32114  ++ts;
32115  ts_after_sub = ts;
32116  for (i = 0; i != struct_count; ++i) {
32117  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
32118  if (!ts_after_sub) return NULL;
32119  }
32120  ts = ts_after_sub;
32121  if (struct_alignment) ctx->struct_alignment = struct_alignment;
32122  }
32123  break;
32124  case '}':
32125  {
32126  size_t alignment = ctx->struct_alignment;
32127  ++ts;
32128  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
32129  ctx->enc_type = 0;
32130  if (alignment && ctx->fmt_offset % alignment) {
32131  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
32132  }
32133  }
32134  return ts;
32135  case 'x':
32136  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
32137  ctx->fmt_offset += ctx->new_count;
32138  ctx->new_count = 1;
32139  ctx->enc_count = 0;
32140  ctx->enc_type = 0;
32141  ctx->enc_packmode = ctx->new_packmode;
32142  ++ts;
32143  break;
32144  case 'Z':
32145  got_Z = 1;
32146  ++ts;
32147  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
32148  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
32149  return NULL;
32150  }
32151  CYTHON_FALLTHROUGH;
32152  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
32153  case 'l': case 'L': case 'q': case 'Q':
32154  case 'f': case 'd': case 'g':
32155  case 'O': case 'p':
32156  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
32157  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
32158  ctx->enc_count += ctx->new_count;
32159  ctx->new_count = 1;
32160  got_Z = 0;
32161  ++ts;
32162  break;
32163  }
32164  CYTHON_FALLTHROUGH;
32165  case 's':
32166  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
32167  ctx->enc_count = ctx->new_count;
32168  ctx->enc_packmode = ctx->new_packmode;
32169  ctx->enc_type = *ts;
32170  ctx->is_complex = got_Z;
32171  ++ts;
32172  ctx->new_count = 1;
32173  got_Z = 0;
32174  break;
32175  case ':':
32176  ++ts;
32177  while(*ts != ':') ++ts;
32178  ++ts;
32179  break;
32180  case '(':
32181  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
32182  break;
32183  default:
32184  {
32185  int number = __Pyx_BufFmt_ExpectNumber(&ts);
32186  if (number == -1) return NULL;
32187  ctx->new_count = (size_t)number;
32188  }
32189  }
32190  }
32191 }
32192 
32193 /* TypeInfoCompare */
32194  static int
32195 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
32196 {
32197  int i;
32198  if (!a || !b)
32199  return 0;
32200  if (a == b)
32201  return 1;
32202  if (a->size != b->size || a->typegroup != b->typegroup ||
32203  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
32204  if (a->typegroup == 'H' || b->typegroup == 'H') {
32205  return a->size == b->size;
32206  } else {
32207  return 0;
32208  }
32209  }
32210  if (a->ndim) {
32211  for (i = 0; i < a->ndim; i++)
32212  if (a->arraysize[i] != b->arraysize[i])
32213  return 0;
32214  }
32215  if (a->typegroup == 'S') {
32216  if (a->flags != b->flags)
32217  return 0;
32218  if (a->fields || b->fields) {
32219  if (!(a->fields && b->fields))
32220  return 0;
32221  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
32222  __Pyx_StructField *field_a = a->fields + i;
32223  __Pyx_StructField *field_b = b->fields + i;
32224  if (field_a->offset != field_b->offset ||
32225  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
32226  return 0;
32227  }
32228  return !a->fields[i].type && !b->fields[i].type;
32229  }
32230  }
32231  return 1;
32232 }
32233 
32234 /* MemviewSliceValidateAndInit */
32235  static int
32236 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
32237 {
32238  if (buf->shape[dim] <= 1)
32239  return 1;
32240  if (buf->strides) {
32241  if (spec & __Pyx_MEMVIEW_CONTIG) {
32242  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
32243  if (unlikely(buf->strides[dim] != sizeof(void *))) {
32244  PyErr_Format(PyExc_ValueError,
32245  "Buffer is not indirectly contiguous "
32246  "in dimension %d.", dim);
32247  goto fail;
32248  }
32249  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
32250  PyErr_SetString(PyExc_ValueError,
32251  "Buffer and memoryview are not contiguous "
32252  "in the same dimension.");
32253  goto fail;
32254  }
32255  }
32256  if (spec & __Pyx_MEMVIEW_FOLLOW) {
32257  Py_ssize_t stride = buf->strides[dim];
32258  if (stride < 0)
32259  stride = -stride;
32260  if (unlikely(stride < buf->itemsize)) {
32261  PyErr_SetString(PyExc_ValueError,
32262  "Buffer and memoryview are not contiguous "
32263  "in the same dimension.");
32264  goto fail;
32265  }
32266  }
32267  } else {
32268  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
32269  PyErr_Format(PyExc_ValueError,
32270  "C-contiguous buffer is not contiguous in "
32271  "dimension %d", dim);
32272  goto fail;
32273  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
32274  PyErr_Format(PyExc_ValueError,
32275  "C-contiguous buffer is not indirect in "
32276  "dimension %d", dim);
32277  goto fail;
32278  } else if (unlikely(buf->suboffsets)) {
32279  PyErr_SetString(PyExc_ValueError,
32280  "Buffer exposes suboffsets but no strides");
32281  goto fail;
32282  }
32283  }
32284  return 1;
32285 fail:
32286  return 0;
32287 }
32288 static int
32289 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
32290 {
32291  if (spec & __Pyx_MEMVIEW_DIRECT) {
32292  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
32293  PyErr_Format(PyExc_ValueError,
32294  "Buffer not compatible with direct access "
32295  "in dimension %d.", dim);
32296  goto fail;
32297  }
32298  }
32299  if (spec & __Pyx_MEMVIEW_PTR) {
32300  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
32301  PyErr_Format(PyExc_ValueError,
32302  "Buffer is not indirectly accessible "
32303  "in dimension %d.", dim);
32304  goto fail;
32305  }
32306  }
32307  return 1;
32308 fail:
32309  return 0;
32310 }
32311 static int
32312 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
32313 {
32314  int i;
32315  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
32316  Py_ssize_t stride = 1;
32317  for (i = 0; i < ndim; i++) {
32318  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
32319  PyErr_SetString(PyExc_ValueError,
32320  "Buffer not fortran contiguous.");
32321  goto fail;
32322  }
32323  stride = stride * buf->shape[i];
32324  }
32325  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
32326  Py_ssize_t stride = 1;
32327  for (i = ndim - 1; i >- 1; i--) {
32328  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
32329  PyErr_SetString(PyExc_ValueError,
32330  "Buffer not C contiguous.");
32331  goto fail;
32332  }
32333  stride = stride * buf->shape[i];
32334  }
32335  }
32336  return 1;
32337 fail:
32338  return 0;
32339 }
32340 static int __Pyx_ValidateAndInit_memviewslice(
32341  int *axes_specs,
32342  int c_or_f_flag,
32343  int buf_flags,
32344  int ndim,
32345  __Pyx_TypeInfo *dtype,
32346  __Pyx_BufFmt_StackElem stack[],
32347  __Pyx_memviewslice *memviewslice,
32348  PyObject *original_obj)
32349 {
32350  struct __pyx_memoryview_obj *memview, *new_memview;
32351  __Pyx_RefNannyDeclarations
32352  Py_buffer *buf;
32353  int i, spec = 0, retval = -1;
32354  __Pyx_BufFmt_Context ctx;
32355  int from_memoryview = __pyx_memoryview_check(original_obj);
32356  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
32357  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
32358  original_obj)->typeinfo)) {
32359  memview = (struct __pyx_memoryview_obj *) original_obj;
32360  new_memview = NULL;
32361  } else {
32362  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
32363  original_obj, buf_flags, 0, dtype);
32364  new_memview = memview;
32365  if (unlikely(!memview))
32366  goto fail;
32367  }
32368  buf = &memview->view;
32369  if (unlikely(buf->ndim != ndim)) {
32370  PyErr_Format(PyExc_ValueError,
32371  "Buffer has wrong number of dimensions (expected %d, got %d)",
32372  ndim, buf->ndim);
32373  goto fail;
32374  }
32375  if (new_memview) {
32376  __Pyx_BufFmt_Init(&ctx, stack, dtype);
32377  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
32378  }
32379  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
32380  PyErr_Format(PyExc_ValueError,
32381  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
32382  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
32383  buf->itemsize,
32384  (buf->itemsize > 1) ? "s" : "",
32385  dtype->name,
32386  dtype->size,
32387  (dtype->size > 1) ? "s" : "");
32388  goto fail;
32389  }
32390  if (buf->len > 0) {
32391  for (i = 0; i < ndim; i++) {
32392  spec = axes_specs[i];
32393  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
32394  goto fail;
32395  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
32396  goto fail;
32397  }
32398  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
32399  goto fail;
32400  }
32401  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
32402  new_memview != NULL) == -1)) {
32403  goto fail;
32404  }
32405  retval = 0;
32406  goto no_fail;
32407 fail:
32408  Py_XDECREF(new_memview);
32409  retval = -1;
32410 no_fail:
32411  __Pyx_RefNannyFinishContext();
32412  return retval;
32413 }
32414 
32415 /* ObjectToMemviewSlice */
32416  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj, int writable_flag) {
32417  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32418  __Pyx_BufFmt_StackElem stack[1];
32419  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32420  int retcode;
32421  if (obj == Py_None) {
32422  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32423  return result;
32424  }
32425  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32426  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32427  &__Pyx_TypeInfo_float, stack,
32428  &result, obj);
32429  if (unlikely(retcode == -1))
32430  goto __pyx_fail;
32431  return result;
32432 __pyx_fail:
32433  result.memview = NULL;
32434  result.data = NULL;
32435  return result;
32436 }
32437 
32438 /* ObjectToMemviewSlice */
32439  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj, int writable_flag) {
32440  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32441  __Pyx_BufFmt_StackElem stack[1];
32442  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32443  int retcode;
32444  if (obj == Py_None) {
32445  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32446  return result;
32447  }
32448  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32449  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32450  &__Pyx_TypeInfo_float, stack,
32451  &result, obj);
32452  if (unlikely(retcode == -1))
32453  goto __pyx_fail;
32454  return result;
32455 __pyx_fail:
32456  result.memview = NULL;
32457  result.data = NULL;
32458  return result;
32459 }
32460 
32461 /* ObjectToMemviewSlice */
32462  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
32463  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32464  __Pyx_BufFmt_StackElem stack[1];
32465  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32466  int retcode;
32467  if (obj == Py_None) {
32468  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32469  return result;
32470  }
32471  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32472  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32473  &__Pyx_TypeInfo_double, stack,
32474  &result, obj);
32475  if (unlikely(retcode == -1))
32476  goto __pyx_fail;
32477  return result;
32478 __pyx_fail:
32479  result.memview = NULL;
32480  result.data = NULL;
32481  return result;
32482 }
32483 
32484 /* ObjectToMemviewSlice */
32485  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj, int writable_flag) {
32486  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32487  __Pyx_BufFmt_StackElem stack[1];
32488  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32489  int retcode;
32490  if (obj == Py_None) {
32491  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32492  return result;
32493  }
32494  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32495  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32496  &__Pyx_TypeInfo_double, stack,
32497  &result, obj);
32498  if (unlikely(retcode == -1))
32499  goto __pyx_fail;
32500  return result;
32501 __pyx_fail:
32502  result.memview = NULL;
32503  result.data = NULL;
32504  return result;
32505 }
32506 
32507 /* ObjectToMemviewSlice */
32508  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj, int writable_flag) {
32509  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32510  __Pyx_BufFmt_StackElem stack[1];
32511  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32512  int retcode;
32513  if (obj == Py_None) {
32514  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32515  return result;
32516  }
32517  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32518  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32519  &__Pyx_TypeInfo_long__double, stack,
32520  &result, obj);
32521  if (unlikely(retcode == -1))
32522  goto __pyx_fail;
32523  return result;
32524 __pyx_fail:
32525  result.memview = NULL;
32526  result.data = NULL;
32527  return result;
32528 }
32529 
32530 /* ObjectToMemviewSlice */
32531  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj, int writable_flag) {
32532  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32533  __Pyx_BufFmt_StackElem stack[1];
32534  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32535  int retcode;
32536  if (obj == Py_None) {
32537  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32538  return result;
32539  }
32540  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32541  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32542  &__Pyx_TypeInfo_long__double, stack,
32543  &result, obj);
32544  if (unlikely(retcode == -1))
32545  goto __pyx_fail;
32546  return result;
32547 __pyx_fail:
32548  result.memview = NULL;
32549  result.data = NULL;
32550  return result;
32551 }
32552 
32553 /* ObjectToMemviewSlice */
32554  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
32555  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32556  __Pyx_BufFmt_StackElem stack[1];
32557  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32558  int retcode;
32559  if (obj == Py_None) {
32560  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32561  return result;
32562  }
32563  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32564  PyBUF_RECORDS_RO | writable_flag, 1,
32565  &__Pyx_TypeInfo_float, stack,
32566  &result, obj);
32567  if (unlikely(retcode == -1))
32568  goto __pyx_fail;
32569  return result;
32570 __pyx_fail:
32571  result.memview = NULL;
32572  result.data = NULL;
32573  return result;
32574 }
32575 
32576 /* ObjectToMemviewSlice */
32577  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
32578  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32579  __Pyx_BufFmt_StackElem stack[1];
32580  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32581  int retcode;
32582  if (obj == Py_None) {
32583  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32584  return result;
32585  }
32586  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32587  PyBUF_RECORDS_RO | writable_flag, 1,
32588  &__Pyx_TypeInfo_int, stack,
32589  &result, obj);
32590  if (unlikely(retcode == -1))
32591  goto __pyx_fail;
32592  return result;
32593 __pyx_fail:
32594  result.memview = NULL;
32595  result.data = NULL;
32596  return result;
32597 }
32598 
32599 /* ObjectToMemviewSlice */
32600  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
32601  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32602  __Pyx_BufFmt_StackElem stack[1];
32603  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32604  int retcode;
32605  if (obj == Py_None) {
32606  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32607  return result;
32608  }
32609  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32610  PyBUF_RECORDS_RO | writable_flag, 1,
32611  &__Pyx_TypeInfo_double, stack,
32612  &result, obj);
32613  if (unlikely(retcode == -1))
32614  goto __pyx_fail;
32615  return result;
32616 __pyx_fail:
32617  result.memview = NULL;
32618  result.data = NULL;
32619  return result;
32620 }
32621 
32622 /* ObjectToMemviewSlice */
32623  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj, int writable_flag) {
32624  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32625  __Pyx_BufFmt_StackElem stack[1];
32626  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32627  int retcode;
32628  if (obj == Py_None) {
32629  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32630  return result;
32631  }
32632  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32633  PyBUF_RECORDS_RO | writable_flag, 1,
32634  &__Pyx_TypeInfo_long__double, stack,
32635  &result, obj);
32636  if (unlikely(retcode == -1))
32637  goto __pyx_fail;
32638  return result;
32639 __pyx_fail:
32640  result.memview = NULL;
32641  result.data = NULL;
32642  return result;
32643 }
32644 
32645 /* MemviewSliceCopyTemplate */
32646  static __Pyx_memviewslice
32647 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
32648  const char *mode, int ndim,
32649  size_t sizeof_dtype, int contig_flag,
32650  int dtype_is_object)
32651 {
32652  __Pyx_RefNannyDeclarations
32653  int i;
32654  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
32655  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
32656  Py_buffer *buf = &from_memview->view;
32657  PyObject *shape_tuple = NULL;
32658  PyObject *temp_int = NULL;
32659  struct __pyx_array_obj *array_obj = NULL;
32660  struct __pyx_memoryview_obj *memview_obj = NULL;
32661  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
32662  for (i = 0; i < ndim; i++) {
32663  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
32664  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
32665  "indirect dimensions (axis %d)", i);
32666  goto fail;
32667  }
32668  }
32669  shape_tuple = PyTuple_New(ndim);
32670  if (unlikely(!shape_tuple)) {
32671  goto fail;
32672  }
32673  __Pyx_GOTREF(shape_tuple);
32674  for(i = 0; i < ndim; i++) {
32675  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
32676  if(unlikely(!temp_int)) {
32677  goto fail;
32678  } else {
32679  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
32680  temp_int = NULL;
32681  }
32682  }
32683  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
32684  if (unlikely(!array_obj)) {
32685  goto fail;
32686  }
32687  __Pyx_GOTREF(array_obj);
32688  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
32689  (PyObject *) array_obj, contig_flag,
32690  dtype_is_object,
32691  from_mvs->memview->typeinfo);
32692  if (unlikely(!memview_obj))
32693  goto fail;
32694  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
32695  goto fail;
32696  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
32697  dtype_is_object) < 0))
32698  goto fail;
32699  goto no_fail;
32700 fail:
32701  __Pyx_XDECREF(new_mvs.memview);
32702  new_mvs.memview = NULL;
32703  new_mvs.data = NULL;
32704 no_fail:
32705  __Pyx_XDECREF(shape_tuple);
32706  __Pyx_XDECREF(temp_int);
32707  __Pyx_XDECREF(array_obj);
32708  __Pyx_RefNannyFinishContext();
32709  return new_mvs;
32710 }
32711 
32712 /* CIntToPy */
32713  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
32714 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32715 #pragma GCC diagnostic push
32716 #pragma GCC diagnostic ignored "-Wconversion"
32717 #endif
32718  const long neg_one = (long) -1, const_zero = (long) 0;
32719 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32720 #pragma GCC diagnostic pop
32721 #endif
32722  const int is_unsigned = neg_one > const_zero;
32723  if (is_unsigned) {
32724  if (sizeof(long) < sizeof(long)) {
32725  return PyInt_FromLong((long) value);
32726  } else if (sizeof(long) <= sizeof(unsigned long)) {
32727  return PyLong_FromUnsignedLong((unsigned long) value);
32728 #ifdef HAVE_LONG_LONG
32729  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
32730  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
32731 #endif
32732  }
32733  } else {
32734  if (sizeof(long) <= sizeof(long)) {
32735  return PyInt_FromLong((long) value);
32736 #ifdef HAVE_LONG_LONG
32737  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
32738  return PyLong_FromLongLong((PY_LONG_LONG) value);
32739 #endif
32740  }
32741  }
32742  {
32743  int one = 1; int little = (int)*(unsigned char *)&one;
32744  unsigned char *bytes = (unsigned char *)&value;
32745  return _PyLong_FromByteArray(bytes, sizeof(long),
32746  little, !is_unsigned);
32747  }
32748 }
32749 
32750 /* CIntFromPy */
32751  static CYTHON_INLINE LongIndexType __Pyx_PyInt_As_LongIndexType(PyObject *x) {
32752 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32753 #pragma GCC diagnostic push
32754 #pragma GCC diagnostic ignored "-Wconversion"
32755 #endif
32756  const LongIndexType neg_one = (LongIndexType) -1, const_zero = (LongIndexType) 0;
32757 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32758 #pragma GCC diagnostic pop
32759 #endif
32760  const int is_unsigned = neg_one > const_zero;
32761 #if PY_MAJOR_VERSION < 3
32762  if (likely(PyInt_Check(x))) {
32763  if (sizeof(LongIndexType) < sizeof(long)) {
32764  __PYX_VERIFY_RETURN_INT(LongIndexType, long, PyInt_AS_LONG(x))
32765  } else {
32766  long val = PyInt_AS_LONG(x);
32767  if (is_unsigned && unlikely(val < 0)) {
32768  goto raise_neg_overflow;
32769  }
32770  return (LongIndexType) val;
32771  }
32772  } else
32773 #endif
32774  if (likely(PyLong_Check(x))) {
32775  if (is_unsigned) {
32776 #if CYTHON_USE_PYLONG_INTERNALS
32777  const digit* digits = ((PyLongObject*)x)->ob_digit;
32778  switch (Py_SIZE(x)) {
32779  case 0: return (LongIndexType) 0;
32780  case 1: __PYX_VERIFY_RETURN_INT(LongIndexType, digit, digits[0])
32781  case 2:
32782  if (8 * sizeof(LongIndexType) > 1 * PyLong_SHIFT) {
32783  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32784  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32785  } else if (8 * sizeof(LongIndexType) >= 2 * PyLong_SHIFT) {
32786  return (LongIndexType) (((((LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0]));
32787  }
32788  }
32789  break;
32790  case 3:
32791  if (8 * sizeof(LongIndexType) > 2 * PyLong_SHIFT) {
32792  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32793  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32794  } else if (8 * sizeof(LongIndexType) >= 3 * PyLong_SHIFT) {
32795  return (LongIndexType) (((((((LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0]));
32796  }
32797  }
32798  break;
32799  case 4:
32800  if (8 * sizeof(LongIndexType) > 3 * PyLong_SHIFT) {
32801  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32802  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32803  } else if (8 * sizeof(LongIndexType) >= 4 * PyLong_SHIFT) {
32804  return (LongIndexType) (((((((((LongIndexType)digits[3]) << PyLong_SHIFT) | (LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0]));
32805  }
32806  }
32807  break;
32808  }
32809 #endif
32810 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
32811  if (unlikely(Py_SIZE(x) < 0)) {
32812  goto raise_neg_overflow;
32813  }
32814 #else
32815  {
32816  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32817  if (unlikely(result < 0))
32818  return (LongIndexType) -1;
32819  if (unlikely(result == 1))
32820  goto raise_neg_overflow;
32821  }
32822 #endif
32823  if (sizeof(LongIndexType) <= sizeof(unsigned long)) {
32824  __PYX_VERIFY_RETURN_INT_EXC(LongIndexType, unsigned long, PyLong_AsUnsignedLong(x))
32825 #ifdef HAVE_LONG_LONG
32826  } else if (sizeof(LongIndexType) <= sizeof(unsigned PY_LONG_LONG)) {
32827  __PYX_VERIFY_RETURN_INT_EXC(LongIndexType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32828 #endif
32829  }
32830  } else {
32831 #if CYTHON_USE_PYLONG_INTERNALS
32832  const digit* digits = ((PyLongObject*)x)->ob_digit;
32833  switch (Py_SIZE(x)) {
32834  case 0: return (LongIndexType) 0;
32835  case -1: __PYX_VERIFY_RETURN_INT(LongIndexType, sdigit, (sdigit) (-(sdigit)digits[0]))
32836  case 1: __PYX_VERIFY_RETURN_INT(LongIndexType, digit, +digits[0])
32837  case -2:
32838  if (8 * sizeof(LongIndexType) - 1 > 1 * PyLong_SHIFT) {
32839  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32840  __PYX_VERIFY_RETURN_INT(LongIndexType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32841  } else if (8 * sizeof(LongIndexType) - 1 > 2 * PyLong_SHIFT) {
32842  return (LongIndexType) (((LongIndexType)-1)*(((((LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
32843  }
32844  }
32845  break;
32846  case 2:
32847  if (8 * sizeof(LongIndexType) > 1 * PyLong_SHIFT) {
32848  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32849  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32850  } else if (8 * sizeof(LongIndexType) - 1 > 2 * PyLong_SHIFT) {
32851  return (LongIndexType) ((((((LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
32852  }
32853  }
32854  break;
32855  case -3:
32856  if (8 * sizeof(LongIndexType) - 1 > 2 * PyLong_SHIFT) {
32857  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32858  __PYX_VERIFY_RETURN_INT(LongIndexType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32859  } else if (8 * sizeof(LongIndexType) - 1 > 3 * PyLong_SHIFT) {
32860  return (LongIndexType) (((LongIndexType)-1)*(((((((LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
32861  }
32862  }
32863  break;
32864  case 3:
32865  if (8 * sizeof(LongIndexType) > 2 * PyLong_SHIFT) {
32866  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32867  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32868  } else if (8 * sizeof(LongIndexType) - 1 > 3 * PyLong_SHIFT) {
32869  return (LongIndexType) ((((((((LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
32870  }
32871  }
32872  break;
32873  case -4:
32874  if (8 * sizeof(LongIndexType) - 1 > 3 * PyLong_SHIFT) {
32875  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32876  __PYX_VERIFY_RETURN_INT(LongIndexType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32877  } else if (8 * sizeof(LongIndexType) - 1 > 4 * PyLong_SHIFT) {
32878  return (LongIndexType) (((LongIndexType)-1)*(((((((((LongIndexType)digits[3]) << PyLong_SHIFT) | (LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
32879  }
32880  }
32881  break;
32882  case 4:
32883  if (8 * sizeof(LongIndexType) > 3 * PyLong_SHIFT) {
32884  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32885  __PYX_VERIFY_RETURN_INT(LongIndexType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32886  } else if (8 * sizeof(LongIndexType) - 1 > 4 * PyLong_SHIFT) {
32887  return (LongIndexType) ((((((((((LongIndexType)digits[3]) << PyLong_SHIFT) | (LongIndexType)digits[2]) << PyLong_SHIFT) | (LongIndexType)digits[1]) << PyLong_SHIFT) | (LongIndexType)digits[0])));
32888  }
32889  }
32890  break;
32891  }
32892 #endif
32893  if (sizeof(LongIndexType) <= sizeof(long)) {
32894  __PYX_VERIFY_RETURN_INT_EXC(LongIndexType, long, PyLong_AsLong(x))
32895 #ifdef HAVE_LONG_LONG
32896  } else if (sizeof(LongIndexType) <= sizeof(PY_LONG_LONG)) {
32897  __PYX_VERIFY_RETURN_INT_EXC(LongIndexType, PY_LONG_LONG, PyLong_AsLongLong(x))
32898 #endif
32899  }
32900  }
32901  {
32902 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32903  PyErr_SetString(PyExc_RuntimeError,
32904  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32905 #else
32906  LongIndexType val;
32907  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32908  #if PY_MAJOR_VERSION < 3
32909  if (likely(v) && !PyLong_Check(v)) {
32910  PyObject *tmp = v;
32911  v = PyNumber_Long(tmp);
32912  Py_DECREF(tmp);
32913  }
32914  #endif
32915  if (likely(v)) {
32916  int one = 1; int is_little = (int)*(unsigned char *)&one;
32917  unsigned char *bytes = (unsigned char *)&val;
32918  int ret = _PyLong_AsByteArray((PyLongObject *)v,
32919  bytes, sizeof(val),
32920  is_little, !is_unsigned);
32921  Py_DECREF(v);
32922  if (likely(!ret))
32923  return val;
32924  }
32925 #endif
32926  return (LongIndexType) -1;
32927  }
32928  } else {
32929  LongIndexType val;
32930  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32931  if (!tmp) return (LongIndexType) -1;
32932  val = __Pyx_PyInt_As_LongIndexType(tmp);
32933  Py_DECREF(tmp);
32934  return val;
32935  }
32936 raise_overflow:
32937  PyErr_SetString(PyExc_OverflowError,
32938  "value too large to convert to LongIndexType");
32939  return (LongIndexType) -1;
32940 raise_neg_overflow:
32941  PyErr_SetString(PyExc_OverflowError,
32942  "can't convert negative value to LongIndexType");
32943  return (LongIndexType) -1;
32944 }
32945 
32946 /* CIntFromPy */
32947  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
32948 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32949 #pragma GCC diagnostic push
32950 #pragma GCC diagnostic ignored "-Wconversion"
32951 #endif
32952  const int neg_one = (int) -1, const_zero = (int) 0;
32953 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32954 #pragma GCC diagnostic pop
32955 #endif
32956  const int is_unsigned = neg_one > const_zero;
32957 #if PY_MAJOR_VERSION < 3
32958  if (likely(PyInt_Check(x))) {
32959  if (sizeof(int) < sizeof(long)) {
32960  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
32961  } else {
32962  long val = PyInt_AS_LONG(x);
32963  if (is_unsigned && unlikely(val < 0)) {
32964  goto raise_neg_overflow;
32965  }
32966  return (int) val;
32967  }
32968  } else
32969 #endif
32970  if (likely(PyLong_Check(x))) {
32971  if (is_unsigned) {
32972 #if CYTHON_USE_PYLONG_INTERNALS
32973  const digit* digits = ((PyLongObject*)x)->ob_digit;
32974  switch (Py_SIZE(x)) {
32975  case 0: return (int) 0;
32976  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
32977  case 2:
32978  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
32979  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32980  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32981  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
32982  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32983  }
32984  }
32985  break;
32986  case 3:
32987  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
32988  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32989  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32990  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
32991  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32992  }
32993  }
32994  break;
32995  case 4:
32996  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
32997  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32998  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32999  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
33000  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33001  }
33002  }
33003  break;
33004  }
33005 #endif
33006 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33007  if (unlikely(Py_SIZE(x) < 0)) {
33008  goto raise_neg_overflow;
33009  }
33010 #else
33011  {
33012  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33013  if (unlikely(result < 0))
33014  return (int) -1;
33015  if (unlikely(result == 1))
33016  goto raise_neg_overflow;
33017  }
33018 #endif
33019  if (sizeof(int) <= sizeof(unsigned long)) {
33020  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
33021 #ifdef HAVE_LONG_LONG
33022  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
33023  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33024 #endif
33025  }
33026  } else {
33027 #if CYTHON_USE_PYLONG_INTERNALS
33028  const digit* digits = ((PyLongObject*)x)->ob_digit;
33029  switch (Py_SIZE(x)) {
33030  case 0: return (int) 0;
33031  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
33032  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
33033  case -2:
33034  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
33035  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
33036  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33037  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
33038  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33039  }
33040  }
33041  break;
33042  case 2:
33043  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
33044  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
33045  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33046  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
33047  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33048  }
33049  }
33050  break;
33051  case -3:
33052  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
33053  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
33054  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33055  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
33056  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33057  }
33058  }
33059  break;
33060  case 3:
33061  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
33062  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
33063  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33064  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
33065  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33066  }
33067  }
33068  break;
33069  case -4:
33070  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
33071  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
33072  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33073  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
33074  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33075  }
33076  }
33077  break;
33078  case 4:
33079  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
33080  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
33081  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33082  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
33083  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33084  }
33085  }
33086  break;
33087  }
33088 #endif
33089  if (sizeof(int) <= sizeof(long)) {
33090  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
33091 #ifdef HAVE_LONG_LONG
33092  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
33093  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
33094 #endif
33095  }
33096  }
33097  {
33098 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
33099  PyErr_SetString(PyExc_RuntimeError,
33100  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
33101 #else
33102  int val;
33103  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
33104  #if PY_MAJOR_VERSION < 3
33105  if (likely(v) && !PyLong_Check(v)) {
33106  PyObject *tmp = v;
33107  v = PyNumber_Long(tmp);
33108  Py_DECREF(tmp);
33109  }
33110  #endif
33111  if (likely(v)) {
33112  int one = 1; int is_little = (int)*(unsigned char *)&one;
33113  unsigned char *bytes = (unsigned char *)&val;
33114  int ret = _PyLong_AsByteArray((PyLongObject *)v,
33115  bytes, sizeof(val),
33116  is_little, !is_unsigned);
33117  Py_DECREF(v);
33118  if (likely(!ret))
33119  return val;
33120  }
33121 #endif
33122  return (int) -1;
33123  }
33124  } else {
33125  int val;
33126  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33127  if (!tmp) return (int) -1;
33128  val = __Pyx_PyInt_As_int(tmp);
33129  Py_DECREF(tmp);
33130  return val;
33131  }
33132 raise_overflow:
33133  PyErr_SetString(PyExc_OverflowError,
33134  "value too large to convert to int");
33135  return (int) -1;
33136 raise_neg_overflow:
33137  PyErr_SetString(PyExc_OverflowError,
33138  "can't convert negative value to int");
33139  return (int) -1;
33140 }
33141 
33142 /* CIntFromPy */
33143  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
33144 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33145 #pragma GCC diagnostic push
33146 #pragma GCC diagnostic ignored "-Wconversion"
33147 #endif
33148  const long neg_one = (long) -1, const_zero = (long) 0;
33149 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33150 #pragma GCC diagnostic pop
33151 #endif
33152  const int is_unsigned = neg_one > const_zero;
33153 #if PY_MAJOR_VERSION < 3
33154  if (likely(PyInt_Check(x))) {
33155  if (sizeof(long) < sizeof(long)) {
33156  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
33157  } else {
33158  long val = PyInt_AS_LONG(x);
33159  if (is_unsigned && unlikely(val < 0)) {
33160  goto raise_neg_overflow;
33161  }
33162  return (long) val;
33163  }
33164  } else
33165 #endif
33166  if (likely(PyLong_Check(x))) {
33167  if (is_unsigned) {
33168 #if CYTHON_USE_PYLONG_INTERNALS
33169  const digit* digits = ((PyLongObject*)x)->ob_digit;
33170  switch (Py_SIZE(x)) {
33171  case 0: return (long) 0;
33172  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
33173  case 2:
33174  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
33175  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
33176  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33177  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
33178  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33179  }
33180  }
33181  break;
33182  case 3:
33183  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
33184  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
33185  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33186  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
33187  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33188  }
33189  }
33190  break;
33191  case 4:
33192  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
33193  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
33194  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33195  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
33196  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33197  }
33198  }
33199  break;
33200  }
33201 #endif
33202 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33203  if (unlikely(Py_SIZE(x) < 0)) {
33204  goto raise_neg_overflow;
33205  }
33206 #else
33207  {
33208  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33209  if (unlikely(result < 0))
33210  return (long) -1;
33211  if (unlikely(result == 1))
33212  goto raise_neg_overflow;
33213  }
33214 #endif
33215  if (sizeof(long) <= sizeof(unsigned long)) {
33216  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
33217 #ifdef HAVE_LONG_LONG
33218  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
33219  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33220 #endif
33221  }
33222  } else {
33223 #if CYTHON_USE_PYLONG_INTERNALS
33224  const digit* digits = ((PyLongObject*)x)->ob_digit;
33225  switch (Py_SIZE(x)) {
33226  case 0: return (long) 0;
33227  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
33228  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
33229  case -2:
33230  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
33231  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
33232  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33233  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
33234  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33235  }
33236  }
33237  break;
33238  case 2:
33239  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
33240  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
33241  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33242  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
33243  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33244  }
33245  }
33246  break;
33247  case -3:
33248  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
33249  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
33250  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33251  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
33252  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33253  }
33254  }
33255  break;
33256  case 3:
33257  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
33258  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
33259  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33260  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
33261  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33262  }
33263  }
33264  break;
33265  case -4:
33266  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
33267  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
33268  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33269  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
33270  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33271  }
33272  }
33273  break;
33274  case 4:
33275  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
33276  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
33277  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33278  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
33279  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33280  }
33281  }
33282  break;
33283  }
33284 #endif
33285  if (sizeof(long) <= sizeof(long)) {
33286  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
33287 #ifdef HAVE_LONG_LONG
33288  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
33289  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
33290 #endif
33291  }
33292  }
33293  {
33294 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
33295  PyErr_SetString(PyExc_RuntimeError,
33296  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
33297 #else
33298  long val;
33299  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
33300  #if PY_MAJOR_VERSION < 3
33301  if (likely(v) && !PyLong_Check(v)) {
33302  PyObject *tmp = v;
33303  v = PyNumber_Long(tmp);
33304  Py_DECREF(tmp);
33305  }
33306  #endif
33307  if (likely(v)) {
33308  int one = 1; int is_little = (int)*(unsigned char *)&one;
33309  unsigned char *bytes = (unsigned char *)&val;
33310  int ret = _PyLong_AsByteArray((PyLongObject *)v,
33311  bytes, sizeof(val),
33312  is_little, !is_unsigned);
33313  Py_DECREF(v);
33314  if (likely(!ret))
33315  return val;
33316  }
33317 #endif
33318  return (long) -1;
33319  }
33320  } else {
33321  long val;
33322  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33323  if (!tmp) return (long) -1;
33324  val = __Pyx_PyInt_As_long(tmp);
33325  Py_DECREF(tmp);
33326  return val;
33327  }
33328 raise_overflow:
33329  PyErr_SetString(PyExc_OverflowError,
33330  "value too large to convert to long");
33331  return (long) -1;
33332 raise_neg_overflow:
33333  PyErr_SetString(PyExc_OverflowError,
33334  "can't convert negative value to long");
33335  return (long) -1;
33336 }
33337 
33338 /* CIntToPy */
33339  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
33340 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33341 #pragma GCC diagnostic push
33342 #pragma GCC diagnostic ignored "-Wconversion"
33343 #endif
33344  const int neg_one = (int) -1, const_zero = (int) 0;
33345 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33346 #pragma GCC diagnostic pop
33347 #endif
33348  const int is_unsigned = neg_one > const_zero;
33349  if (is_unsigned) {
33350  if (sizeof(int) < sizeof(long)) {
33351  return PyInt_FromLong((long) value);
33352  } else if (sizeof(int) <= sizeof(unsigned long)) {
33353  return PyLong_FromUnsignedLong((unsigned long) value);
33354 #ifdef HAVE_LONG_LONG
33355  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
33356  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
33357 #endif
33358  }
33359  } else {
33360  if (sizeof(int) <= sizeof(long)) {
33361  return PyInt_FromLong((long) value);
33362 #ifdef HAVE_LONG_LONG
33363  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
33364  return PyLong_FromLongLong((PY_LONG_LONG) value);
33365 #endif
33366  }
33367  }
33368  {
33369  int one = 1; int little = (int)*(unsigned char *)&one;
33370  unsigned char *bytes = (unsigned char *)&value;
33371  return _PyLong_FromByteArray(bytes, sizeof(int),
33372  little, !is_unsigned);
33373  }
33374 }
33375 
33376 /* CIntFromPy */
33377  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
33378 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33379 #pragma GCC diagnostic push
33380 #pragma GCC diagnostic ignored "-Wconversion"
33381 #endif
33382  const char neg_one = (char) -1, const_zero = (char) 0;
33383 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33384 #pragma GCC diagnostic pop
33385 #endif
33386  const int is_unsigned = neg_one > const_zero;
33387 #if PY_MAJOR_VERSION < 3
33388  if (likely(PyInt_Check(x))) {
33389  if (sizeof(char) < sizeof(long)) {
33390  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
33391  } else {
33392  long val = PyInt_AS_LONG(x);
33393  if (is_unsigned && unlikely(val < 0)) {
33394  goto raise_neg_overflow;
33395  }
33396  return (char) val;
33397  }
33398  } else
33399 #endif
33400  if (likely(PyLong_Check(x))) {
33401  if (is_unsigned) {
33402 #if CYTHON_USE_PYLONG_INTERNALS
33403  const digit* digits = ((PyLongObject*)x)->ob_digit;
33404  switch (Py_SIZE(x)) {
33405  case 0: return (char) 0;
33406  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
33407  case 2:
33408  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
33409  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
33410  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33411  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
33412  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33413  }
33414  }
33415  break;
33416  case 3:
33417  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
33418  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
33419  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33420  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
33421  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33422  }
33423  }
33424  break;
33425  case 4:
33426  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
33427  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
33428  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33429  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
33430  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
33431  }
33432  }
33433  break;
33434  }
33435 #endif
33436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33437  if (unlikely(Py_SIZE(x) < 0)) {
33438  goto raise_neg_overflow;
33439  }
33440 #else
33441  {
33442  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33443  if (unlikely(result < 0))
33444  return (char) -1;
33445  if (unlikely(result == 1))
33446  goto raise_neg_overflow;
33447  }
33448 #endif
33449  if (sizeof(char) <= sizeof(unsigned long)) {
33450  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
33451 #ifdef HAVE_LONG_LONG
33452  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
33453  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33454 #endif
33455  }
33456  } else {
33457 #if CYTHON_USE_PYLONG_INTERNALS
33458  const digit* digits = ((PyLongObject*)x)->ob_digit;
33459  switch (Py_SIZE(x)) {
33460  case 0: return (char) 0;
33461  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
33462  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
33463  case -2:
33464  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
33465  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
33466  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33467  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
33468  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33469  }
33470  }
33471  break;
33472  case 2:
33473  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
33474  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
33475  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33476  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
33477  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33478  }
33479  }
33480  break;
33481  case -3:
33482  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
33483  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
33484  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33485  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
33486  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33487  }
33488  }
33489  break;
33490  case 3:
33491  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
33492  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
33493  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33494  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
33495  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33496  }
33497  }
33498  break;
33499  case -4:
33500  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
33501  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
33502  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33503  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
33504  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33505  }
33506  }
33507  break;
33508  case 4:
33509  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
33510  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
33511  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33512  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
33513  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
33514  }
33515  }
33516  break;
33517  }
33518 #endif
33519  if (sizeof(char) <= sizeof(long)) {
33520  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
33521 #ifdef HAVE_LONG_LONG
33522  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
33523  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
33524 #endif
33525  }
33526  }
33527  {
33528 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
33529  PyErr_SetString(PyExc_RuntimeError,
33530  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
33531 #else
33532  char val;
33533  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
33534  #if PY_MAJOR_VERSION < 3
33535  if (likely(v) && !PyLong_Check(v)) {
33536  PyObject *tmp = v;
33537  v = PyNumber_Long(tmp);
33538  Py_DECREF(tmp);
33539  }
33540  #endif
33541  if (likely(v)) {
33542  int one = 1; int is_little = (int)*(unsigned char *)&one;
33543  unsigned char *bytes = (unsigned char *)&val;
33544  int ret = _PyLong_AsByteArray((PyLongObject *)v,
33545  bytes, sizeof(val),
33546  is_little, !is_unsigned);
33547  Py_DECREF(v);
33548  if (likely(!ret))
33549  return val;
33550  }
33551 #endif
33552  return (char) -1;
33553  }
33554  } else {
33555  char val;
33556  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33557  if (!tmp) return (char) -1;
33558  val = __Pyx_PyInt_As_char(tmp);
33559  Py_DECREF(tmp);
33560  return val;
33561  }
33562 raise_overflow:
33563  PyErr_SetString(PyExc_OverflowError,
33564  "value too large to convert to char");
33565  return (char) -1;
33566 raise_neg_overflow:
33567  PyErr_SetString(PyExc_OverflowError,
33568  "can't convert negative value to char");
33569  return (char) -1;
33570 }
33571 
33572 /* CheckBinaryVersion */
33573  static int __Pyx_check_binary_version(void) {
33574  char ctversion[5];
33575  int same=1, i, found_dot;
33576  const char* rt_from_call = Py_GetVersion();
33577  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
33578  found_dot = 0;
33579  for (i = 0; i < 4; i++) {
33580  if (!ctversion[i]) {
33581  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
33582  break;
33583  }
33584  if (rt_from_call[i] != ctversion[i]) {
33585  same = 0;
33586  break;
33587  }
33588  }
33589  if (!same) {
33590  char rtversion[5] = {'\0'};
33591  char message[200];
33592  for (i=0; i<4; ++i) {
33593  if (rt_from_call[i] == '.') {
33594  if (found_dot) break;
33595  found_dot = 1;
33596  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
33597  break;
33598  }
33599  rtversion[i] = rt_from_call[i];
33600  }
33601  PyOS_snprintf(message, sizeof(message),
33602  "compiletime version %s of module '%.100s' "
33603  "does not match runtime version %s",
33604  ctversion, __Pyx_MODULE_NAME, rtversion);
33605  return PyErr_WarnEx(NULL, message, 1);
33606  }
33607  return 0;
33608 }
33609 
33610 /* InitStrings */
33611  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
33612  while (t->p) {
33613  #if PY_MAJOR_VERSION < 3
33614  if (t->is_unicode) {
33615  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
33616  } else if (t->intern) {
33617  *t->p = PyString_InternFromString(t->s);
33618  } else {
33619  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
33620  }
33621  #else
33622  if (t->is_unicode | t->is_str) {
33623  if (t->intern) {
33624  *t->p = PyUnicode_InternFromString(t->s);
33625  } else if (t->encoding) {
33626  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
33627  } else {
33628  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
33629  }
33630  } else {
33631  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
33632  }
33633  #endif
33634  if (!*t->p)
33635  return -1;
33636  if (PyObject_Hash(*t->p) == -1)
33637  return -1;
33638  ++t;
33639  }
33640  return 0;
33641 }
33642 
33643 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
33644  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
33645 }
33646 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
33647  Py_ssize_t ignore;
33648  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
33649 }
33650 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
33651 #if !CYTHON_PEP393_ENABLED
33652 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33653  char* defenc_c;
33654  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
33655  if (!defenc) return NULL;
33656  defenc_c = PyBytes_AS_STRING(defenc);
33657 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33658  {
33659  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
33660  char* c;
33661  for (c = defenc_c; c < end; c++) {
33662  if ((unsigned char) (*c) >= 128) {
33663  PyUnicode_AsASCIIString(o);
33664  return NULL;
33665  }
33666  }
33667  }
33668 #endif
33669  *length = PyBytes_GET_SIZE(defenc);
33670  return defenc_c;
33671 }
33672 #else
33673 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33674  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
33675 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33676  if (likely(PyUnicode_IS_ASCII(o))) {
33677  *length = PyUnicode_GET_LENGTH(o);
33678  return PyUnicode_AsUTF8(o);
33679  } else {
33680  PyUnicode_AsASCIIString(o);
33681  return NULL;
33682  }
33683 #else
33684  return PyUnicode_AsUTF8AndSize(o, length);
33685 #endif
33686 }
33687 #endif
33688 #endif
33689 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33690 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
33691  if (
33692 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33693  __Pyx_sys_getdefaultencoding_not_ascii &&
33694 #endif
33695  PyUnicode_Check(o)) {
33696  return __Pyx_PyUnicode_AsStringAndSize(o, length);
33697  } else
33698 #endif
33699 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
33700  if (PyByteArray_Check(o)) {
33701  *length = PyByteArray_GET_SIZE(o);
33702  return PyByteArray_AS_STRING(o);
33703  } else
33704 #endif
33705  {
33706  char* result;
33707  int r = PyBytes_AsStringAndSize(o, &result, length);
33708  if (unlikely(r < 0)) {
33709  return NULL;
33710  } else {
33711  return result;
33712  }
33713  }
33714 }
33715 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
33716  int is_true = x == Py_True;
33717  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
33718  else return PyObject_IsTrue(x);
33719 }
33720 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
33721  int retval;
33722  if (unlikely(!x)) return -1;
33723  retval = __Pyx_PyObject_IsTrue(x);
33724  Py_DECREF(x);
33725  return retval;
33726 }
33727 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
33728 #if PY_MAJOR_VERSION >= 3
33729  if (PyLong_Check(result)) {
33730  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
33731  "__int__ returned non-int (type %.200s). "
33732  "The ability to return an instance of a strict subclass of int "
33733  "is deprecated, and may be removed in a future version of Python.",
33734  Py_TYPE(result)->tp_name)) {
33735  Py_DECREF(result);
33736  return NULL;
33737  }
33738  return result;
33739  }
33740 #endif
33741  PyErr_Format(PyExc_TypeError,
33742  "__%.4s__ returned non-%.4s (type %.200s)",
33743  type_name, type_name, Py_TYPE(result)->tp_name);
33744  Py_DECREF(result);
33745  return NULL;
33746 }
33747 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
33748 #if CYTHON_USE_TYPE_SLOTS
33749  PyNumberMethods *m;
33750 #endif
33751  const char *name = NULL;
33752  PyObject *res = NULL;
33753 #if PY_MAJOR_VERSION < 3
33754  if (likely(PyInt_Check(x) || PyLong_Check(x)))
33755 #else
33756  if (likely(PyLong_Check(x)))
33757 #endif
33758  return __Pyx_NewRef(x);
33759 #if CYTHON_USE_TYPE_SLOTS
33760  m = Py_TYPE(x)->tp_as_number;
33761  #if PY_MAJOR_VERSION < 3
33762  if (m && m->nb_int) {
33763  name = "int";
33764  res = m->nb_int(x);
33765  }
33766  else if (m && m->nb_long) {
33767  name = "long";
33768  res = m->nb_long(x);
33769  }
33770  #else
33771  if (likely(m && m->nb_int)) {
33772  name = "int";
33773  res = m->nb_int(x);
33774  }
33775  #endif
33776 #else
33777  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
33778  res = PyNumber_Int(x);
33779  }
33780 #endif
33781  if (likely(res)) {
33782 #if PY_MAJOR_VERSION < 3
33783  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
33784 #else
33785  if (unlikely(!PyLong_CheckExact(res))) {
33786 #endif
33787  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
33788  }
33789  }
33790  else if (!PyErr_Occurred()) {
33791  PyErr_SetString(PyExc_TypeError,
33792  "an integer is required");
33793  }
33794  return res;
33795 }
33796 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
33797  Py_ssize_t ival;
33798  PyObject *x;
33799 #if PY_MAJOR_VERSION < 3
33800  if (likely(PyInt_CheckExact(b))) {
33801  if (sizeof(Py_ssize_t) >= sizeof(long))
33802  return PyInt_AS_LONG(b);
33803  else
33804  return PyInt_AsSsize_t(b);
33805  }
33806 #endif
33807  if (likely(PyLong_CheckExact(b))) {
33808  #if CYTHON_USE_PYLONG_INTERNALS
33809  const digit* digits = ((PyLongObject*)b)->ob_digit;
33810  const Py_ssize_t size = Py_SIZE(b);
33811  if (likely(__Pyx_sst_abs(size) <= 1)) {
33812  ival = likely(size) ? digits[0] : 0;
33813  if (size == -1) ival = -ival;
33814  return ival;
33815  } else {
33816  switch (size) {
33817  case 2:
33818  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
33819  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33820  }
33821  break;
33822  case -2:
33823  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
33824  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33825  }
33826  break;
33827  case 3:
33828  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
33829  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33830  }
33831  break;
33832  case -3:
33833  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
33834  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33835  }
33836  break;
33837  case 4:
33838  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
33839  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33840  }
33841  break;
33842  case -4:
33843  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
33844  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33845  }
33846  break;
33847  }
33848  }
33849  #endif
33850  return PyLong_AsSsize_t(b);
33851  }
33852  x = PyNumber_Index(b);
33853  if (!x) return -1;
33854  ival = PyInt_AsSsize_t(x);
33855  Py_DECREF(x);
33856  return ival;
33857 }
33858 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
33859  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
33860  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
33861 #if PY_MAJOR_VERSION < 3
33862  } else if (likely(PyInt_CheckExact(o))) {
33863  return PyInt_AS_LONG(o);
33864 #endif
33865  } else {
33866  Py_ssize_t ival;
33867  PyObject *x;
33868  x = PyNumber_Index(o);
33869  if (!x) return -1;
33870  ival = PyInt_AsLong(x);
33871  Py_DECREF(x);
33872  return ival;
33873  }
33874 }
33875 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
33876  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
33877 }
33878 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
33879  return PyInt_FromSize_t(ival);
33880 }
33881 
33882 
33883 #endif /* Py_PYTHON_H */
Base class for linear operators. This class serves as interface for all derived classes.
int LongIndexType
Definition: types.h:60